"Validation of viewstate Mac failed" exception

Source: Internet
Author: User
The viewstate mechanism of Asp.net brings us a lot of convenience, but sometimes it also produces some inexplicable problems. The verification error of viewstae is often encountered, and this problem has been encountered before. The solution is to set the enableviewstatemac attribute of the page with the error to "false", or simply go to the Web. <system. the setting in Web> <pages> node properties is OK, and no errors are made, and no security problems occur.
Today I encountered a similar problem, and the exception information is similar (not clearly remembered, it seems a little different). The prompt message is as follows:

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.

Description:An unhandled exception occurred during the execution of the current Web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception details:System. web. httpexception: 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.

In the recorded Chinese log, the data cannot be verified.
However, this time is different. If you set enableviewstatemac to false, the problem cannot be solved, and another exception prompt will appear:
The State information is invalid for this page and might be upted. 

A bunch of such problems are also found on the internet, but there is no better explanation (even if they do not understand ). The thought is about encryption and decryption. We can see that there is a viewstateencryptionmode attribute under the <pages> node, so we set it
Never. Try again to solve the problem. However, if there is no error, the default configuration is changed, encryption is not performed, and verification is not performed, will there be a new and more serious problem -------- security problems?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.