Thursday, October 31, 2013

Validation of viewstate MAC failed Error

This error will cause due to the View State.

To avoid this error kindly follow the below :



Solution 1:
Kindly add the Below generated Machine Key on web.config file.

ASP Machine Key Code Generator

ASP.NET machineKey Generator

This is an application that will generate a valid machineKey block with random, secure, hard-coded keys that you can paste inside the <system.web> in your web.config or machine.config file. Hard-coded encryption and validation keys are needed if you have a web farm, if you use passwordFormat=Encrypted with ASP.NET 2.0's Membership provider, or if you have certain ViewState issues. I discussed those reasons more in-depth in my blog posts about "Invalid Viewstate" errors and the ASP.NET Membership Encrypted passwordFormat.


Solution 2:

adding the below code in the web.config had fixed the issue for me.
 
<pages enableeventvalidation="false" viewstateencryptionmode="Never"></pages>
 
 




No comments:

Post a Comment