我花了大约两天时间研究这个问题,似乎无法找到解决方案,或者所提供的解决方案似乎没有完全解决我遇到的问题。
说明
Error occurred System.Web.HttpException (0x80004005): The state information is invalid for this page and might be corrupted. ---> System.Web.UI.ViewStateException: Invalid viewstate.
Client IP: <removed>
Port: 21884
Referer: <removed>
Path: /PathToPage/Page.aspx
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; MS-RTC LM 8)
ViewState: /wEPDwULLTEyNTU4MDc4NT....<removed by user>... ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Convert.FromBase64String(String s)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
--- End of inner exception stack trace ---
at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
at System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadAllState()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
答案 0 :(得分:0)
因为此问题仅在更新面板页面上发生,所以我怀疑在更新面板打破viewstate之后出现错误,并且您很简单没有捕获并且您看不到此错误。
要找到它们,临时解决方案是删除更新面板以查看是否有任何错误。
第二种解决方案是在较小的部分压缩和剪切视图状态,以防中间的某个代理或路由器中断它。
还有一些内容可以阅读:ASP.Net Post timeout和CryptographicException: Padding is invalid and cannot be removed and Validation of viewstate MAC failed