2011-06-17 64 views
1

我有一個包含文本框,下拉列表控件,複選框,gridview,超鏈接的用戶控件。當頁面加載 時,其中一些控件會顯示,而其餘部分則基於用戶從下拉列表控件和複選框的選擇而可見。'System.Web.HttpException:無法加載視圖狀態

該頁面的功能與用戶使用上述控件輸入到一個文件中的數據相同,並且在一個gridview中顯示該文件以及 用戶信息,如他的姓名,創建日期,服務類型,聯繫人信息,服務時間和評論以及上面創建的文件。

該頁面對我來說沒有任何錯誤,但用戶正在'System.Web.HttpException:無法加載視圖狀態'。偶爾出錯。

我該如何重現此錯誤?我該如何解決它?

這裏是整個錯誤消息:

 
Exception of type 'System.Web.HttpUnhandledException' was thrown. 
    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. 
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) 
    at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) 
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) 
    at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) 
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) 
    at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) 
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) 
    at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) 
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) 
    at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) 
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) 
    at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) 
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) 
    at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) 
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) 
    at System.Web.UI.Page.LoadAllState() 
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  
    at System.Web.UI.Page.HandleError(Exception e) 
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
    at System.Web.UI.Page.ProcessRequest() 
    at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) 
    at System.Web.UI.Page.ProcessRequest(HttpContext context) 
    at ASP.app_uatserviceoutcome_aspx.ProcessRequest(HttpContext context) 
    in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\bad754dd\a11f74ff\App_Web_uatserviceoutcome.aspx.ae7ca9bd.xvr6rpyt.0.cs:line 0 
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 

任何幫助不勝感激。

回答

0

這是一個經典的網絡形式陷阱,令人討厭難以追蹤 - 見this question的一些建議

相關問題