ASP. net controls encountered a depressing problem, the page has a view switch function to achieve, you can choose to use chart or grid to view data, including Grid only, chart Only, grid with chart, and other la S. At the beginning, we found that when switching from grid at bottom to grid at right, the view State of the chart is always null, and the following error occurs when the grid only to grid at right is implemented.
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.
Description:An unhandled exception occurred during the execution of the current Web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception details:System. web. httpexception: 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.
Stack trace:
[Httpexception (0x80004005): 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.] system. web. UI. control. loadviewstaterecursive (Object savedstate) + 189 system. web. UI. control. loadviewstaterecursive (Object savedstate) + 414 system. web. UI. control. addedcontrol (Control, int32 index) + 291 system. web. UI. controlcollection. add (control child) + 153 usoft. aurora. webcontrols. analysisreport. createchildcontrols () in E: \ project \ Aurora \ code. v6 \ Aurora \ analysiswebcontrols \ analysisreport. CS: 172 system. web. UI. control. ensurechildcontrols () + 100 system. web. UI. control. prerenderrecursiveinternal () + 38 system. web. UI. control. prerenderrecursiveinternal () + 125 system. web. UI. control. prerenderrecursiveinternal () + 125 system. web. UI. page. processrequestmain () + 1499
|
The error information is also detailed. You can see the cause of the error at a glance, but you did not expect such a requirement on Web controls.
The problem has been solved, but I will not post it for the time being. I hope to hear your comments.