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.
I think you may have your viewstate disabled.
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</upd atepanel>
<updatepanel>controls</upd atepanel>
controls
</updatepanel>
Where "controls" are usually a validator, label, form field combo. Not sure how helpfult that is though.
<updatepanel>
<updatepanel>controls</upd
<updatepanel>controls</upd
controls
</updatepanel>
Where "controls" are usually a validator, label, form field combo. Not sure how helpfult that is though.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
- 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.