A list of good articles to help understand ASP. NET viewstate
Viewstate: all you wanted to know
Viewstate and JavaBean the ASP. NET alternative part give us a overview of how viewstae works
Taking a bite out of ASP. NET viewstate is another msdn article
Understanding ASP. NET view State by Scott Mitchell from 4guysfromrolla.com is the lastes msdn article about viewstate
My personal understanding is as follows:
One of the major advantages of ASP. NET is that many HTML controls can be set to runat = "server" to control on the server.
This is also a cause for misunderstanding of viewstate.
Viewstate is not used to restore the value of form (here form refers to a common form used to submit data to the server.
For example, Textbox, submit, checkbox, select, and so on in input. Because these controls implement the ipostbackdatahandler interface, their values are not saved in viewstate, so viewstate is not used for restoration.
However, their other attributes, such as background color, are saved in viewstate if they exist.
Viewstate is used to restore and save those
Set to runat = "server,
The ipostbackdatahandler interface is not implemented,
The property of control. It is an attribute, not just a value.
Such as label, calendar, and other control introduced by Microsoft.