众果搜的博客

脚踏大地,仰望星空,致力于在线网络工具的开发与普及,以及其他思考

Search(博客搜索)

热文排行

最近发表

最新评论及回复

« 文章照妖镜桌面收费版问题反映错别字在线检查工具上线 »

此页的状态信息无效,可能已损坏。解决之道

 在网上找了找,没有找到解决办法,最后发现是程序中使用了ViewState,向其中保存了空值。代码如下,如果没有注释中与逻辑条件,就会报错。应该容易理解,你破坏了ViewState的存储结构,所以报错。它在页面加载的时候不知道如何读取数据了。
if (tbAnswerA.Visible == true)//说明输入了 && tbAnswerA.Text!=""
        {
            userHuiDa[jiBie, tiBie] = tbAnswerA.Text;
            litUserHuiDa.Text = answerStr + tbAnswerA.Text;
            ViewState["userHuiDa" + tiBie.ToString()] = userHuiDa;
      }

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Web.HttpException: 此页的状态信息无效,可能已损坏。

源错误:

[没有相关的源行]
 

源文件: f:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\htdocs\93aefb87\b9d27afd\App_Web_4yxryetq.0.cs    行: 0

堆栈跟踪:

[EndOfStreamException: 无法在流的结尾之外进行读取。]   System.IO.__Error.EndOfFile() +56   System.IO.BinaryReader.ReadByte() +7674287   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +41   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +404   System.Web.UI.ObjectStateFormatter.Deserialize(Stream inputStream) +135[ArgumentException: 序列化的数据无效。]   System.Web.UI.ObjectStateFormatter.Deserialize(Stream inputStream) +199   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +297   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4   System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37   System.Web.UI.HiddenFieldPageStatePersister.Load() +113[ViewStateException: 无效的视图状态。 Client IP: 127.0.0.1 Port:  User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) ViewState: /wEPDwUKLTk4NTA1NDI0OQ8WCB4OcmlnaHRXcm9uZ0thbjEFATAeCW5vdGVzS2FuMQUBMB4IZGFBbkthbjEFATAeCnVzZXJIdWlEYTIWAgIBD2QWHgIBDxYCHgRUZXh0BQExZAIDDxYCHwQFATNkAgsPFgIfBAUh5ZOq5Liq5pWw5a2X5piv5LiO5LyX5LiN5ZCM55qE77yfZAINDw8WBB4ISW1hZ2VVcmwFSX4vZWR1Y2F0aW9uX2dyYWR1YXRlX2NvdXJzZV90b29scy9pbWFnZV96aGlfc2hhbmdfdGlfc2hlbmcvamlfYmllXzEvMy5qcGceB1Zpc2libGVnZGQCDw8PFgQfBQVKfi9lZHVjYXRpb25fZ3JhZHVhdGVfY291cnNlX3Rvb2xzL2ltYWdlX3poaV9zaGFuZ190aV9zaGVuZy9qaV9iaWVfMS8xYS5qcGcfBmhkZAIRDw8WBB8FBUp+L2VkdWNhdGlvbl9ncmFkdWF0ZV9jb3Vyc2VfdG9vbHMvaW1hZ2VfemhpX3NoYW5nX3RpX3NoZW5nL2ppX2JpZV8xLzFiLmpwZx8GaGRkAhMPDxYEHwUFSn4vZWR1Y2F0aW9uX2dyYWR1YXRlX2NvdXJzZV90b29scy9pbWFnZV96aGlfc2hhbmdfdGlfc2hlbmcvamlfYmllXzEvMWMuanBnHwZoZGQCFQ8PFgQfBQVKfi9lZHVjYXRpb25fZ3JhZHVhdGVfY291cnNlX3Rvb2xzL2ltYWdlX3poaV9zaGFuZ190aV9zaGVuZ...][HttpException (0x80004005): 此页的状态信息无效,可能已损坏。]   System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +106   System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState) +14   System.Web.UI.HiddenFieldPageStatePersister.Load() +217   System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +105   System.Web.UI.Page.LoadAllState() +43   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242   System.Web.UI.Page.ProcessRequest() +80   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21   System.Web.UI.Page.ProcessRequest(HttpContext context) +49   ASP.education_graduate_course_tools_zhi_shang_xun_lian_aspx.ProcessRequest(HttpContext context) in f:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\htdocs\93aefb87\b9d27afd\App_Web_4yxryetq.0.cs:0   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
 

 

“/htdocs”应用程序中的服务器错误。
--------------------------------------------------------------------------------

此页的状态信息无效,可能已损坏。
 


--------------------------------------------------------------------------------

版本信息: Microsoft .NET Framework 版本:2.0.50727.3620; ASP.NET 版本:2.0.50727.3618

 

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-Blog 1.8 Spirit Build 80722 Code detection by Codefense

Copyright www.zhongguosou.com. Some Rights Reserved.