Preserving viewstate across multiple pages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an aspx page (page1.aspx) that post back to another aspx page
(page2.aspx)
“page2.aspx†has a button called back, when the user click on this button it
is supposed to return to “page1.aspxâ€, when the user returns to “page1.aspxâ€
I want to restore the viewstate of the page so the page would have the same
data as the user left it.
How can I achieve this behavior?
Thanks
 
check out Page.SavePageStateToPersistenceMedium /
LoadPageStateFromPersistenceMedium
use this to save the viewstate off somewhere ( Session / Cache / DB / ... )
and reload it as required
 
You are correct.

And I apologize , I have too many things cooking at one time.

The way we do this is by a custom state management scheme that saves the
page state before a new page is requested and restores the state every time
the page is requested regardless of POST. Basically before you navigate
away from the page you loop through the controls on the page saving off any
values of interest. And when the page is navigated to you do the same thing
in reverse.

clear as mud right ?
 
Back
Top