1.

What is View State & how it is implemented?

Answer»

View state is another client side state management technique in ASP.NET to store client's information, i.e., in some cases the client needs to protect information briefly after a postback, at that point the view state is the favored route for doing it. It stores information in the produced HTML utilizing the hidden field, not on the server.

View State gives PAGE level state management i.e., as long as the client is on the present page, the state is accessible and the client sidetracks to the following page and the present page state is lost. View State can store any sort of information since it is item type yet it is best not to store complex information because of the requirement for serialization and deserilization on each postback. View state is on by DEFAULT for all server-side controls of ASP.NET with a PROPERTY EnableviewState SET to true.

Let US see with an example how ViewState is utilized & implemented. In the below example we try to save the count of postbacks on each button click.



Discussion

No Comment Found