On the Asp.net 2.0 page, "view status cannot be loaded..." appears ..." Solution to the error (Author: Hai ya)

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.