我正在使用ASP.Net 4.0,並且它僅在單個頁面和單個瀏覽器中引發錯誤。這個錯誤只發生在任何其他瀏覽器(即Chrome,Firefox,Safari,Opera)中的IE瀏覽器中,這個頁面運行正常並且工作正常,但是當我們調用此頁面的任何按鈕事件時,此頁面只會在IE中給出錯誤在IE中,但如果我們使用的不是IE瀏覽器,它可以正常工作。我太堅持爲什麼這個錯誤只發生在IE瀏覽器,我試了很多得到這個錯誤,但我失敗了。誰能幫我出我描述這個錯誤信息:無法加載視圖狀態。僅在IE中出現錯誤
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.
異常詳細信息:
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.
源錯誤:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
堆棧跟蹤:
[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) +327
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +148 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +225
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +148 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +225 System.Web.UI.Page.LoadAllState() +312
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +747
截圖:
小心顯示引發錯誤的代碼? – 2012-01-06 05:00:17
哪個IE版本,什麼以及如何進行動態控制,並且您有更新面板嗎? – V4Vendetta 2012-01-06 05:01:53
我檢查IE-7,8,9所有版本,並在所有瀏覽器上拋出此錯誤... – 2012-01-06 05:06:13