gpt4 book ai didi

jquery - 该页面的状态信息无效并且可能已损坏。 (仅在 IE 中)

转载 作者:行者123 更新时间:2023-12-03 22:30:31 27 4
gpt4 key购买 nike

任何人都可以帮我解决这个异常(exception)吗?我尝试了一些修复,但没有任何效果。我仅在 IE(7、8 和 9)中遇到此异常。

当我第一次加载页面时,它会弹出一个下拉菜单。我在其中选择一个特定的供应商,它使页面回发并返回所需的信息。如果我更改供应商,它仍然会加载信息。当我使用 $.ajax 请求动态地将控件加载到页面上,然后返回并更改下拉列表选择(选择不同的供应商)时,它会崩溃并给出以下异常。同样,它只发生在 IE 中。

The state information is invalid for this page and might be corrupted. 
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.

Exception Details: System.Web.HttpException: The state information is invalid for this page and might be corrupted.

Source Error:


[No relevant source lines]


Source File: c:\Users\tmalik\AppData\Local\Temp\Temporary ASP.NET Files\root\6691c708\751e6443\App_Web_a3kdfsht.2.cs Line: 0

Stack Trace:


[FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters. ]
System.Convert.FromBase64String(String s) +0
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +77
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() +147

[ViewStateException: Invalid viewstate.
Client IP: 127.0.0.1
Port:
Referer: http://localhost:57289/vendor.aspx
Path: /vendor.aspx
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; MDDR)
ViewState: 2D1IMRanPXfVARbRp1ooiwD71WHybNzxSNLbbA0G3MxKeo7m52dHWLBPGdnMH5JthTnPVt7UES/PVx39dfZYHbr0/DL7J58mvA2I4wRUSdDShVxvZqC7ZPZWcatowpZ7VYaD9PFKW7OkgppCwmePFuYnpU8kWDT5TvSLqN50Flrqpv0zCM9YoCKemfesa68rqBkkSTijcxnxdDCgvzSl72giI4ZhwK92wD22Ma6scW4PFjRZeTsKoowJq+JqJGuBMEepwKguFUy4dX86UIULnJ7NQsgZW1aQvpZdnfSRCSYrWhFWPhKTPsS622eaQYShsxddPs/mfEB26f54WS+iBYuk3mWm8jr6sWvsOIRtwH8b3E/5UujbgAxTNVg8BhzpSFvmE4KwGKo0tKuuqOFtP0pjpaAI7fV3EQ1M7BVQSAVrtBevRFJ0PlCPrU2aQms2LVeE5POqTJGtY+74xWkdCtLzT04Ug4R+SMBRElQBqX/5A54OHj2ghYjJ/3tgg4ToGUX2xrQ/c70lrphP+kabGVM2Op4DFjZAaOZj/CDVUurH2BYXKuJdUvzbf2zHngoOnqZGqrw3n6V6HGcnHNKxfuGQ20MPdxJYCbYHGiRqixzV1NxJoHFHbYCVx3IlrqF0W44AFKm2gzzk3V8zu9lUjyFNvUNBMjNaZeekLtcWpszhKrm8WhVnWQAk1CXxKJqyK0RC3...]

[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.]
System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +235
System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState) +14
System.Web.UI.HiddenFieldPageStatePersister.Load() +251
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +106
System.Web.UI.Page.LoadAllState() +43
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8431
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
System.Web.UI.Page.ProcessRequest() +78
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.vendor_aspx.ProcessRequest(HttpContext context) in c:\Users\tmalik\AppData\Local\Temp\Temporary ASP.NET Files\root\6691c708\751e6443\App_Web_a3kdfsht.2.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

最佳答案

好的,这是我想出的解决方案/技巧。我的问题是,动态添加用户控件(通过 ajax 请求)到页面上会更改页面的 View 状态并引发异常。经过研究,我发现 View 状态存储页面的状态(属性和设置)。一旦您从 Web 服务返回控件 html,就会有某种 View 状态存储到页面上。当您回发到服务器时,它会在解密 View 以重建页面时抛出异常。我只是使用 jquery 删除了页面回发上的那些控件(动态添加的),问题就解决了。

//In my case "VendorListDropDownSearchable", causes the page post back.
$("#VendorListDropDownSearchable").change( function () {
$("#UserControl1DIV").remove(); //removing the place holder holding control1
$("#UserControl2DIV").remove(); //same as above
});

关于jquery - 该页面的状态信息无效并且可能已损坏。 (仅在 IE 中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8946374/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com