简体   繁体   English

Viewstate验证失败。 原因:视图状态提供了完整性检查失败

[英]Viewstate verification failed. Reason: The viewstate supplied failed integrity check

It's been a while that I'm getting "Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster." 已经有一段时间我得到“视图状态MAC验证失败。如果此应用程序由Web场或集群托管,请确保配置指定相同的validationKey和验证算法.AutoGenerate不能在集群中使用。” error on GridView post-backs. GridView post-backs上的错误。

I've defined the same machine-keys on my sites but I (sometimes) get the message. 我在我的网站上定义了相同的机器密钥,但我(有时)得到了消息。

Any clue? 任何线索?

Add this to your web.config file in the system.web section: 将其添加到system.web部分中的web.config文件中:

<machinekey validationkey="xxx" decryptionkey="xxx" validation="SHA1" decryption="AES" />

Provide your own validation and decryption keys ("xxx" above), 提供您自己的验证和解密密钥(上面的“xxx”),

which you can try to generated from here 您可以尝试从这里生成

Please do refer this microsoft kb 请参考这个微软kb

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM