Persisting data is a real problem in ASP.Net due to the stateless nature of
HTTP. When talking about persisting a value, you need to think about scope.
How long do you want the variable to exist? What should it be exposed to?
For example, should it have Application Scope, so that any page being viewed
by any user can access it? Should it be in Session State, so that each user
has their own separate variable that remains for the lifetime of the User
Session? Should it have Page scope, such as ViewState, so that it is
persisted only for the duration of the current Page and PostBacks of that
Page? Should it be stored in a database, where it will persist permanently,
and is still avialable to any Page that needs it for any user? The more
carefully you consider this question, the less you'll have to change later.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Craig Buchanan" <so*****@somewhere.com> wrote in message
news:eV*************@TK2MSFTNGP11.phx.gbl...
I'm using a viewstate key/value to store a serialized instance of a class.
If I redirect to another aspx page, the viewstate is lost. Is this the
intended behavior of the viewstate? Is there a work around? Cookies, I
suppose.
Thanks,
Craig Buchanan