what is Viewstate

View state is used by the ASP.NET page framework to automatically save the values of the page and of each control just prior to rendering to the page. When the page is posted, one of the first tasks performed by page processing is to restore view state. State management is the process by which you maintain state and page information over multiple requests for the same or different pages.

Client-side options are:

* The ViewState property

* Query strings

* Hidden fields

* Cookies

Server-side options are:

* Application state

* Session state

Use the View State property to save data in a hidden field on a page. Because ViewState stores data on the page, it is limited to items that can be serialized. If you want to store more complex items in View State, you must convert the items to and from a string. ASP.NET provides the following ways to retain variables between requests:

Context.Handler object Use this object to retrieve public members of one Web form’s class from a subsequently displayed Web form.

Query strings Use these strings to pass information between requests and responses as part of the Web address. Query strings are visible to the user, so they should not contain secure information such as passwords.

Query strings Use these strings to pass information between requests and responses as part of the Web address. Query strings are visible to the user, so they should not contain secure information such as passwords.

View state ASP.NET stores items added to a page’s ViewState property as hidden fields on the page.

Session state Use Session state variables to store items that you want keep local to the current session (single user).

Application state Use Application state variables to store items that you want be available to all users of the application.