No title page ABC
Let's take a look at the "State of view", that is, viewstate, in our view of the ASP.net generated page code, we can see the following code, that is ViewState existence form < input type = "hidden" name = "__ VIEWSTATE "value =" DDWYNDMZNDYZMJI7DDW7BDXPPDM+OZ47BDX0PDTSPG ...
Objects that can be serialized (serialized to save objects as encoded) can be stored in viewstate. General ViewState is not encrypted is BASE64 encoding, can also be configured in the Web.config encryption, the specific information can be queried.
The role of ViewState in ASP.net is to save the state of the control, the next time it is posted to the server, and the server restores the state of the control. (The state of the control includes: values and events.) )
Understanding ViewState is the process of using post to give the server, you can find some "failed to load view state" error when writing asp.net.
Error 1: After the server control is bound state, the control state Mygrid changed. EditItemIndex = 5;
Mygrid. DataSource = DT;
Mygrid. DataBind ();
Mygrid. EditItemIndex = 3;//This will cause an error.
Error 2, modifying the server control ID
The server control ID is already defined in the ASPX or Ascx page, but the new ID of the control is redefined in the CS file.
Error 3, if you really have a strange error, try adding some controls manually and try again.
WEBPART.CONTROLS.ADD (New Label ()); It is
WEBPART.CONTROLS.ADD (RIGHTDEFINE1);
Original address: http://www.cnblogs.com/king_astar/archive/2005/06/01/165763.html