. Net error: failed to load view status. 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.

Source: Internet
Author: User

. Net error: failed to load view status. 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.

 

At system. Web. UI. Control. loadviewstaterecursive (Object savedstate)
At system. Web. UI. Control. loadviewstaterecursive (Object savedstate)
At system. Web. UI. Control. loadviewstaterecursive (Object savedstate)
At system. Web. UI. Control. addedcontrol (Control, int32 index)
At system. Web. UI. controlcollection. Add (control child)
At system. Web. UI. webcontrols. rowcontrolcollection. Add (control child)
At system. Web. UI. controlcollection. addat (int32 index, control child)
At system. Web. UI. webcontrols. rowcontrolcollection. addat (int32 index, control child)
At system. Web. UI. webcontrols. tablerowcollection. Add (tablerow row)

 

This error is caused by some controls. If the date control is dynamically loaded and the server returns the result, this error is triggered. If the date control is removed, it is normal.

 

Solution:

This problem occurs due to viewstate.

Add this. Page. enableviewstate = false;

 

There are a lot of discussions about this on the Internet, and it is easy to take a detour to look at other people's solutions. In fact, the above Code can solve the problem

 

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.