【发布时间】:2015-04-15 16:36:57
【问题描述】:
所以我在一台计算机上出现此错误(而不是在其他两台计算机上):
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, [...]
它发生在开发计算机上,因此一切都在计算机上运行,“如果此应用程序由 Web Farm 或集群托管”的断言是 FALSE
根据 MSDN 博客,我应该删除表单的 action 属性(ask_full_report.aspx)
<form id="form1" runat="server" method="post" action="full_report.aspx">
但我不想删除 action 属性,我想将我的表单提交给full_report.aspx。
这是我的 Web.config(我删除了 appSettings 下的一些键)
<configuration>
<appSettings>
<add key="URL_BASE" value=""/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
对于this Answer:我不使用ViewStateUserKey
请问你有什么想法吗?
注意:我不认为它与
重复- Setting ViewStateUserKey gives me a "Validation of viewstate MAC failed" error
- Validation of viewstate MAC failed [重复]
额外资源:MSDN - HttpException Due to Invalid Viewstate After Installing .NET Framework 3.5 SP1
编辑:今天,没有采取任何行动,我不再有错误。我没有打开这篇文章,因为这个错误没有得到很好的记录。如果有人有解决方案,请发布答案。
【问题讨论】: