验证 viewstate mac 失败异常
我有一个问题,我在堆栈溢出流上搜索并找到了一些答案,但没有一个对我有用,我有一个网络应用程序,它在本地主机上运行,但是当我在线托管它时,它给了我一个错误:
<customErrors mode="Off" >
必须是我做到了,然后我去使用我的应用程序,它给了我以下一个:
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
任何帮助都会很棒,谢谢
I have a question and i searched on stack-over flow and found some answer but none of it works for me ,i have a web application it works on the local host but when i host it online it gives me and error that :
<customErrors mode="Off" >
must be off i made that then i gone to use my application it gives me the following one :
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
any help will be great ,thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这样做会失去安全优势,但最快的解决方案是在 web.config 中设置
enableViewStateMac="false"
。如果您的 ViewState 非常大,并且您在页面加载完成之前进行回发,有时会发生这种情况。如果您使用 ViewState 作为数据存储库,这可能就是发生这种情况的原因。我还会检查您的标记并确保您没有任何未关闭的
标记。
You lose security benefits by doing this, but the quickest solution would be to set
enableViewStateMac="false"
in the web.config.This can sometimes happen if your ViewState is very large, and you postback before the page has finished loading. If you're using ViewState as a data repository, that's probably why this happens. I would also inspect your markup and make sure that you don't have any unclosed
<script>
tags.