the total fees the registrant will incur and puts it in a textbox (not a
label because it has to be passed to another page).
txtTotalFees.Text = Format(dblTotalFees, "Currency")
The subroutine works fine IF I call it from PageLoad, or I assign it to a
button for recalculating the total fees, or the user clicks the Reset
button, or if they click a control that has AutoPostback set to true.
Basically anything that loads or postbacks the page.
BUT...When it comes time to submit the page and go to the next page I have
this code:
If IsValid Then
CalcFees() 'recalcs fees and updates textbox
Server.Transfer("Confirmation.aspx", True)
End If
When the user gets to the next page I put the total fees in another textbox.
EXCEPT it isn't updated to most recent total. I know because I can comment
out the "Server.Transfer" so that it stays at the registration page AND THE
CORRECT TOTAL IS DISPLAYED!?!?!
What is it about the Server.Transfer that "forgets" what the value of the
textbox should be?
Ken "BiggMakk" McCroryHi Ken
Try this:
Server.Transfer("Confirmation.aspx", True)
This sets the parameter preserveForm to true, hence preserving any
variables still available.
You can then retrieve the value from your previous page on the
Confirmation.aspx page by using Request.Form("totalFees")
Hope that helps :)
sze
Thanks for the try but I am already using the True to preserve variables.
(See original post. It's there.)
Ken "BiggMakk" McCrory
"sze" <szeying.tan@.gmail.com> wrote in message
news:1110401185.776188.29550@.o13g2000cwo.googlegro ups.com...
> Hi Ken
> Try this:
> Server.Transfer("Confirmation.aspx", True)
> This sets the parameter preserveForm to true, hence preserving any
> variables still available.
> You can then retrieve the value from your previous page on the
> Confirmation.aspx page by using Request.Form("totalFees")
> Hope that helps :)
> sze
Ah, sorry. I didn't notice it in your code at first glance.
Here's a helpful page from MSDN about preserving state between pages.
http://msdn.microsoft.com/library/d...etweenPages.asp
Hope that helps.
I solved this by using SmartNavigation and turning on Autopostback for every
control that can affect the total fees. Before someone says SmartNav doesn't
work in browsers other than IE, you're right. Someone else in a different
post of mine pointed out Smart Scroller by Strength Technologies at this web
site:
http://www.strengthtechnologies.com...l/Download.aspx
It works even in Firefox.
Now the Total fees gets updated before the user hits the Submit button and
the correct value gets passed to the next page. It also removes the need for
the manual "Recalculate Fees" button that I had on the page.
--
Ken "BiggMakk" McCrory
"Ken McCrory" <klm355t@.removefornospammers.smsu.edu> wrote in message
news:OjfvdfOJFHA.688@.TK2MSFTNGP10.phx.gbl...
> It's me and my registration page again. I have a subroutine that
> calculates the total fees the registrant will incur and puts it in a
> textbox (not a label because it has to be passed to another page).
> txtTotalFees.Text = Format(dblTotalFees, "Currency")
> The subroutine works fine IF I call it from PageLoad, or I assign it to a
> button for recalculating the total fees, or the user clicks the Reset
> button, or if they click a control that has AutoPostback set to true.
> Basically anything that loads or postbacks the page.
> BUT...When it comes time to submit the page and go to the next page I have
> this code:
> If IsValid Then
> CalcFees() 'recalcs fees and updates textbox
> Server.Transfer("Confirmation.aspx", True)
> End If
> When the user gets to the next page I put the total fees in another
> textbox. EXCEPT it isn't updated to most recent total. I know because I
> can comment out the "Server.Transfer" so that it stays at the registration
> page AND THE CORRECT TOTAL IS DISPLAYED!?!?!
> What is it about the Server.Transfer that "forgets" what the value of the
> textbox should be?
> Ken "BiggMakk" McCrory
Yeah Ken the control works with FireFox and I.E!!!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
0 comments:
Post a Comment