E
et
I'm not sure I understand the use of the ViewState.
Do I understand correctly that values of controls are automatically held in
a hidden control called ViewState?
If so, then why can't we get them, or how do we get that value? I always
have to set the ViewState("FirstName") = txtBox.text myself before a
postback is done, otherwise, the value of ViewState("FirstName") is always
empty; there doesn't seem to be a way to retrieve that information when
needed unless manually set.
If I am setting the value of the ViewState myself, then aren't I doing
duplicate work if the value of the control should already be held somewhere?
And doesn't that meant that this hidden control is taking up resources when
it's unretrieveable, so why use it.
Is it more likely that the ViewState is just like the Session, except it
lasts for only a page, and is lost when the page changes.
And if so, does that mean there is a viewstate sitting there taking up
resources that we can't get. Should I turn it off on each control, and then
manually set ViewState myself?
Thanks for all your help, I've read an awful lot of articles already but if
you find a good one, let me know.
Do I understand correctly that values of controls are automatically held in
a hidden control called ViewState?
If so, then why can't we get them, or how do we get that value? I always
have to set the ViewState("FirstName") = txtBox.text myself before a
postback is done, otherwise, the value of ViewState("FirstName") is always
empty; there doesn't seem to be a way to retrieve that information when
needed unless manually set.
If I am setting the value of the ViewState myself, then aren't I doing
duplicate work if the value of the control should already be held somewhere?
And doesn't that meant that this hidden control is taking up resources when
it's unretrieveable, so why use it.
Is it more likely that the ViewState is just like the Session, except it
lasts for only a page, and is lost when the page changes.
And if so, does that mean there is a viewstate sitting there taking up
resources that we can't get. Should I turn it off on each control, and then
manually set ViewState myself?
Thanks for all your help, I've read an awful lot of articles already but if
you find a good one, let me know.