错误:
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.
我正在使用 ASP.NET 4.0 并在浏览器上留下无法触摸的页面然后返回并单击某个 LinkButton 后出现此错误。
请注意,我已将此部分添加到 web.config:
<machineKey validationKey="5D063F8696973939183E8CD13363F9B1D2F3D267CAD70E5F0602A81603AB77F9AD82919311A00CEF867FA1216898BE6FE32DF267AEA98E8E18837B375998621C" decryptionKey="DD1D0F9CD56447D829DC9040C651AA5235C3F0FEDB8C91C8A45960C30F0A4314"
validation="SHA1"
decryption="AES" />
但我仍然收到此错误。我想它可能会在会话过期或类似的情况下发生。但是如何在不禁用视图状态的 MAC 加密的情况下避免它呢?
谢谢