How to fix ASP.NET error – Validation of ViewState MAC Failed
When hosting your ASP.NET applications on Windows Web Hosting server, your website may face a common error usually when you Submit a Form on your website like a Contact Form or a Registration Form. The error will read like below.
“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”
To get rid of this error in your application, please add the below code to your web.config file to solve the validation of viewstate mac issue.
<pages enableViewStateMac=”False” />
Please note that most probably there must be already a and element in your web.config file so just add the attribute enableViewStateMac to start of element.
If issue still persists, then please also add below to your web.config file.
4B25FD44B27C” validation=”SHA1″ decryption=”AES” />
We hope this helps.
6,392 total views, 1 views today