Link to home
Start Free TrialLog in
Avatar of brettr
brettr

asked on

Why doesn't form save values on back button click?

What are some of the reasons an asp.net (3.5) form may not save form values from user input after clicking submit then clicking the back button?  I have a muti page registration process.  If the user moves to the next page or encounters an error that puts them on the eror page, all of their input is erased when clicking the back button.   All of the field values are inside an updatepanel.
Avatar of novynov
novynov
Flag of United States of America image

I just did a simple test scenario as follows:

- Created a page with a textbox and two buttons (one "Submit", one "Next")
- On click of the Submit button, I process whatever I need to
- On the Next button, I redirect to another page
- Clicking the browser's back button revealed the previous form with the values still plugged in.
- If I combine the 2 buttons into 1 (i.e. process form and then redirect), I get the same behavior.

So...can you give me a bit more details about your page structure, and maybe include some code snippets? I'd love to be of help if I can.
Avatar of Nasir Razzaq
I think you may have your viewstate disabled.
Avatar of brettr
brettr

ASKER

ViewState is enabled on the master and content pages but it doesn't make a difference.  The general setup in the content page is:

<updatepanel>
   <updatepanel>controls</updatepanel>
   <updatepanel>controls</updatepanel>
   controls
</updatepanel>

Where "controls" are usually a validator, label, form field combo.   Not sure how helpfult that is though.
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brettr

ASKER

Ok.  I know a short circuit would be to store the values temporarily on submission and just apply them back (if not null) on page_load.  Is there a better way?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial