viewstate - 无效 View 状态错误

标签 viewstate scriptresource.axd

我收到有关 ScriptResource.axd 的无效 View 状态错误。只是想知道你们中是否有人可以帮助我解决这个问题。错误是:

2009-02-24 09:46:30,021 [13] DEBUG ASP.global_asax [(null)] - Request start - URL: /Web/ScriptResource.axd?d=E9hlvtsn8Gr1MyjysW1gFDFYr4CVwstY-sC22tRu5V8d7UyEYz3FhVYGrlhY87n2ihgKh58RrMRhK-Yk2WcQahEaCg_asTInqHK
2009-02-24 09:46:30,021 [13] DEBUG ASP.global_asax [(null)] - Application_AuthenticateRequest started
2009-02-24 09:46:30,021 [13] ERROR ASP.global_asax [(null)] - Unexpected error.  User presented with Site Error page.
System.Web.HttpException: Invalid viewstate.
   at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType)
   at System.Web.UI.Page.DecryptString(String s)
   at System.Web.Handlers.ScriptResourceHandler.DecryptParameter(NameValueCollection queryString)
   at System.Web.Handlers.ScriptResourceHandler.ProcessRequestInternal(HttpResponse response, NameValueCollection queryString, VirtualFileReader fileReader)
   at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext context)
   at System.Web.Handlers.ScriptResourceHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

这发生在生产环境中。我无法在开发或测试环境中重现此问题。此外,这些页面只能由经过身份验证的用户访问。如果您能对此事有所了解,那就太好了。

最佳答案

我认为不同的浏览器会因不同的原因而发生这些错误,这使得追踪变得非常困难。

IE8错误

微软表示 IE8 中的一个错误(在某些情况下)会向服务器生成虚假请求,这不会影响用户,但会导致服务器端记录错误。

请参阅此处的讨论:Bug IE8 – 4K dropped - "Invalid viewstate" when loading ScriptResource.axd (编辑:由于某种原因,链接现在需要登录,抱歉)

...特别是 EricLaw-MSFT 的更新,他说:

It is worth mentioning that anyone who is experiencing a problem here in IE6/IE7 or Firefox is encountering a different problem that is not related to the IE8 issue described below.

这篇博文还描述了这些错误:Bugs in IE8's Lookahead Downloader

他们说改变设置 Content-Type 的方式将有助于解决一些错误,尽管不是全部 - 他们说这是由他们仍在研究的各种模糊情况引起的。

更新:自 2010 年 4 月 1 日起,这些 IE8 错误已通过 IE8 累积更新 (KB980182) 得到修复。
本帖:IE8 Lookahead Downloader Fixed除了等待世界上的每个人下载修复程序之外,还提供有关错误和其他可能/部分解决方法(例如 this one )的更多详细信息。

其他浏览器

尚未弄清楚,但其他浏览器也会生成这些错误,大概是出于不同的原因。

网络农场

此问题不仅限于在网络场上运行的网站,但如果您正在运行场,请查看 this answer by jesal这可能会有所帮助

关于viewstate - 无效 View 状态错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/588176/

相关文章:

asp.net - viewstate MAC 验证失败。

c# - Asp.net EnableViewStateMac 和恶意代码 [12 月安全更新]

c#.net 使用向导控件从动态框保持控件状态

ASP.NET:压缩 ViewState

javascript - 带有 Mb 压缩的 ScriptResource.axd

asp.net - ScriptResource.axd 请求的特定缓存问题

iis-7 - 反向代理 (ARR) 和 ScriptResource.axd 问题

asp.net - 如何处理 ASP.net 的神秘隐藏值? (__VIEWSTATE)

javascript - ASP.NET AJAX 控制工具包文件上传在 Scriptresource.axd 中引发错误