user3709136
user3709136

Reputation: 1

Can i come back to a predefined viewstate of a page after coming back from another page?

How can i do this?

i can not use history.back or history.go(-1)

Upvotes: 0

Views: 48

Answers (1)

mnsr
mnsr

Reputation: 12437

Here is one way to do it: Put everything in a Session.

Load all the page1.aspx stuff into a class object, then add it to a Session (obviously before you go to the next page). Then when you go back check if that session exists, if it does, load the page using that class.

var myClass = new MyPage1Save 
{ 
    // load all the things you want saved
}

Session["Page1"] = myClass;

Upvotes: 1

Related Questions