Failed to load viewstate. Happening only occasionally. Tough to recreate

后端 未结 9 1791
陌清茗
陌清茗 2020-12-09 18:05

Details of Error are given below. This error happens only occasionally / rarely / sometimes and there aren\'t any steps to reproduce it.

How can I know which Control

相关标签:
9条回答
  • 2020-12-09 18:27

    Unfortunately there is no way to see which exactly is the guilty control that is not added correctly to the control hierarchy.

    There is!

    Disable "Just my code" in debugging settings. And catch all thrown exceptions (check 'thrown' for Common Language Runtime in the dialog opened by Ctrl-Alt-E).

    After the exception occurs, go to the nearest stack frame where the Control object is available and examine its ClientID and parents.

    0 讨论(0)
  • 2020-12-09 18:29

    You can probably reproduce this by stopping the page before it is fully loaded, and then submitting a postback. If the server wasn't able to get the complete viewstate from the server, then it won't be able to re-create it on postback, hence the crash.

    0 讨论(0)
  • 2020-12-09 18:32

    I've seen this error when using a gridview. It would happen when user interaction caused a postback before the page was done rendering completely.

    I believe it was fixed in VS2005 SP1 however.

    0 讨论(0)
提交回复
热议问题