Xpode.com        Click here to Print this article.

Why the object needs to be serialized while storing in view state

Serialization is the process of converting the state of an object into a form that can be persisted or transported. This is necessary because sometimes you want to keep rich instances of classes, but you can only store it in a certain format. Serialization provides a quick way of converting back and forth. View State stores a collection of objects that maintain their state across postbacks. The way that ASP.NET accomplishes this is by outputting a hidden form field named __ViewState to each page it renders. Within the value attribute of that hidden form field contains a set of objects that make up ViewState. If you want a rich object to participate in ViewState, you must mark it as serializable, applying the Serializable attribute to your class.






Contributed by:
Guest
Guest user is that user who have done some activity on website without login. Activity contains commenting on any article, uploading an image on website etc.

Resourse address on xpode.com
http://www.xpode.com/Print.aspx?Articleid=159

Click here to go on website