2011-06-17 69 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的一些建议

相关问题