In Asp.net 2.0, the following error occurs when the page control is dynamically changed:
View status can be loaded. The Control tree in which the view status is being loaded must match the control tree used to save the view status during the previous request. For example, when a control is added dynamically, the control added during the sending back must match the type and position of the control added during the initial request.
The reason is that when the user tries to load another control during sending back, because the viewstate of the first control still exists, the server tries to restore the status of a user control that does not exist.
Solution: simply add enableviewstate = "false" to the page entry. Is it easy.
InstanceCode:
<% @ Page Language = "C #" validaterequest = "false" enableviewstate = "false" masterpagefile = "~ /Admin/masterpage. Master "autoeventwireup =" true "codefile =" news. aspx. cs "inherits =" admin_news "Title =" untitled page "%>
Source: http://blog.csdn.net/hiyavip