Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to maintain view state across differents pages

Status
Not open for further replies.

ASPnetNovice

Programmer
Apr 28, 2005
19
US
Hello,

I was wondering how can I maintain state after I leave a page.

In other words I have a 6 page questionaire that I am creating online, and If a user fills page 1 and then goes to page 2 but for some reason decides to go back to page 1; I need to be able to have my application remember the information that was already typed in page 1.

My idea was to store the contents of the view state hidden field ("__VIEWSTATE") into a session variable and then restore that value when necessary. (will this work ?)

I am having difficulties with this approach , for one thing I can't find a way to edit the value of the "__VIEWSTATE" variable.

How can one access the value attribute of a simple tag such as <input type="hidden" values=""> from code ???

I will appreciate any suggestion.

Thanks
 
Another approach would be to create a class (which could be stored as a session variable) which contains each of the answers and then use this class to populate the relevant fields on each page if they exist.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top