• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 403
  • Last Modified:

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.
2 Solutions
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.
I think you may have your viewstate disabled.
brettrAuthor Commented:
ViewState is enabled on the master and content pages but it doesn't make a difference.  The general setup in the content page is:


Where "controls" are usually a validator, label, form field combo.   Not sure how helpfult that is though.
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

It could have to do something with the AJAX then as AJAX breaks the history.
brettrAuthor Commented:
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?
have you done some experiments with outputcache?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now