0

I'm receiving a very standard Viewstate error in a very specific scenario in one of current projects.

Sys.WebForms.PageRequestManagerServerErrorException: Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.

My issue, is that this is a customer driven forms designer, and all controls are dynamic, there is also a lot of skip logic on the form, so most controls are not visible at any given time, and it appears to be the toggling of this visibility that is causing the issue. Only in one very specific pattern however. As I am not having any luck re-creating the issue on a simpler form, or tracking down the specific control that is not being re-rendered correctly. Then I thought a sure way to figure this out would be to display the entire control tree at the bottom of the page every postback. then I can compare the tree before and after the error, and see what is changing. But I'm not sure how to do this.

4

1 回答 1

0

刚找到,Page标签中的Trace属性就是我需要的。

<%@ Page Trace="true" %>

http://msdn.microsoft.com/en-US/library/kthye016%28v=vs.80%29

于 2012-05-22T15:25:07.863 回答