S
Shadow Lynx
I realize that his question has been asked, in many other forms, many
times in this group. Even so, my tired eyes have not yet found a
sufficient answer, so I've decided to "reask" it even though I'm sure
this will offend some of the more seasoned verterans of this board.
The Players:
Consider a simple web form, which I'll call Page A, that has a couple
of controls on it. It's not important what they are, only that they're
static (not dynamically created) controls. Our old friend ViewState
and Request.Form keeps track of the values and settings of these
controls as the page is posted back to itself.
Consider a second web form, which I'll call Page B, that also has a
couple of (different) controls on it.
The Game:
1. After filling out some information on Page A, a button on that page
is clicked which causes a postback and the event handler for the button
calls a Response.Redirect to Page B.
2. After sticking some data in Page B's form fields, a button on that
page is clicked which causes postback and the event handler calls a
Response.Redirect back to Page A.
3. Back on Page A, all of the data entered is gone. Going back to Page
B, all of that data is gone as well.
The Question:
How do you "keep" the data in the form fields of a page when you leave
that page and how do you "restore" it when you return? I know that
HTTP is inherantly stateless and I know it's possible to manually save
each piece of data in the Session, but that is extremely tedious to say
the least.
I want to know of an "easy" way to store all of the form field data (in
the Session would be fine) so that subsequent returns to the page will
show me the original values I put in, and I do NOT want to do any of
this manually. The concept is a ViewState that persists across
different page requests. An acceptable solution would simply "remember
and recall" just the values of the form fields, but the ultimate
solution would also do that for all properties of controls (such as
which are hidden, enabled, etc.)
If there is no elegant solution for this then maybe I'm just barking up
the wrong tree and should ask for it as an ASP.NET 3.x feature.
times in this group. Even so, my tired eyes have not yet found a
sufficient answer, so I've decided to "reask" it even though I'm sure
this will offend some of the more seasoned verterans of this board.
The Players:
Consider a simple web form, which I'll call Page A, that has a couple
of controls on it. It's not important what they are, only that they're
static (not dynamically created) controls. Our old friend ViewState
and Request.Form keeps track of the values and settings of these
controls as the page is posted back to itself.
Consider a second web form, which I'll call Page B, that also has a
couple of (different) controls on it.
The Game:
1. After filling out some information on Page A, a button on that page
is clicked which causes a postback and the event handler for the button
calls a Response.Redirect to Page B.
2. After sticking some data in Page B's form fields, a button on that
page is clicked which causes postback and the event handler calls a
Response.Redirect back to Page A.
3. Back on Page A, all of the data entered is gone. Going back to Page
B, all of that data is gone as well.
The Question:
How do you "keep" the data in the form fields of a page when you leave
that page and how do you "restore" it when you return? I know that
HTTP is inherantly stateless and I know it's possible to manually save
each piece of data in the Session, but that is extremely tedious to say
the least.
I want to know of an "easy" way to store all of the form field data (in
the Session would be fine) so that subsequent returns to the page will
show me the original values I put in, and I do NOT want to do any of
this manually. The concept is a ViewState that persists across
different page requests. An acceptable solution would simply "remember
and recall" just the values of the form fields, but the ultimate
solution would also do that for all properties of controls (such as
which are hidden, enabled, etc.)
If there is no elegant solution for this then maybe I'm just barking up
the wrong tree and should ask for it as an ASP.NET 3.x feature.