Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     

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.

Share this article   |    Print    |    Article read by 2495 times
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.
Related Articles:
Related Interview Questions: