视图状态MAC的验证失败例外 [英] validation of viewstate mac failed Exception

查看:114
本文介绍了视图状态MAC的验证失败例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我搜索了堆栈在流,发现了一些答案,但它没有一个对我的作品,我有一个Web应用程序它工作在本地主机上,但是当我在网上举办它,它给了我和错误

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

推荐答案

您做这个失去保障福利,但最快的解决办法是设置 enableViewStateMac =false的在web.config中。

You lose security benefits by doing this, but the quickest solution would be to set enableViewStateMac="false" in the web.config.

<pages enableViewStateMac="false" ...>

这有时会发生,如果你的ViewState是非常大的,你投递的页面加载完成之前。如果你使用ViewState的作为数据存储库,这可能是为什么发生这种情况。我还要检查您的标记,并确保你没有任何未关闭的&LT;脚本&GT; 标记。

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.

这篇关于视图状态MAC的验证失败例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆