ASP.NET 2.0: How to make a page remember the viewstate without creating history points?

I have a page with multiple fields and a runtime generated image. The content of this page is inside the UpdatePanel. There is a button to go to the secondary page which has a button that calls javascript: history.go (-1) when clicked.

The problem is that the first page is doing a full request instead of postback, or just using the state it was in before going from it. That is, the fields are all reset to their default values, thus confusing the user. I would like their values ​​to be preserved regardless of navigation. I don't want to create a new history state for every field change.

Any ideas?

+1


source to share


2 answers


The only other option is to track the state of the field in the cookie on the client side using JavaScript (which has limitations). It would be better to have an AJAX call that was made prior to navigating to your secondary page, which would allow the server to save the page state so that when you navigate back, you can correctly display that state in the browser.



0


source


I think I'll try the AJAX idea when I have a little time to work on it. I'll probably just post back the viewstate field: P Thanks for typing.



0


source







All Articles