I have a simple class with some properties and other data. Until I attach the serializable attribute to the class, I cannot save the class object in viewstate.
Why can a ViewState contain only serializable objects?
When the request view is transferred back to the browser as a serialized view embedded in the generated HTML code of the page, it makes sense that only serializable objects can be placed in it (otherwise it may not display what it contains.) Then this viewstate is de-serialized during the next request.
POCO, serialisable, . , viewstate, .. :
http://weblogs.asp.net/infinitiesloop/archive/2006/08/03/Truly-Understanding-Viewstate.aspx
.
ViewState .
, Session. , .
, , viewstate, ( ).
, , , , , .
, : - Asp.Net HTTP, , , ( , asp.net), , .