Preserving viewstate across multiple pages

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
 
G

gerry

check out Page.SavePageStateToPersistenceMedium /
LoadPageStateFromPersistenceMedium
use this to save the viewstate off somewhere ( Session / Cache / DB / ... )
and reload it as required
 
G

gerry

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 ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top