Validation of ViewState Mac failed
If your page doesn’t load slowly and you are not on a web farm, this little tipp might help you. Most people suggest to add the following attributes to the Page directive:
<pages enableEventValidation=“false“ viewStateEncryptionMode =“Never“
This is known to be a security risk and in my case it didn’t fix the problem.
I think I found another way to eliminate the Error, add this to your Button which triggers the Postback Event:
23 PostBackUrl=”~/yoursite.aspx”
Just post it back to the same site explicitly and you should be fine.
Edit: Another discovery, you can use the maxPageSateFieldLength attribute of the Pages element in the web.config. That will split the viewstate across multiple hidden fields if the content length is larger than maxPageSateFieldLength.
Hope that helps!

2 Comments on “Validation of ViewState Mac failed”
I’m interested, how did setting the PostBackUrl change the page and get rid of the error?
In my case it was hard to test as my problem was that the page was loading slowly, and the “__EVENTVALIDATION” section (at the bottom of the page) was not yet in the transmitted HTML so couldn’t be in the passed POST variables (as I understand it). Hmmm…
Cheers,
Swetha
very..very…nice post. Thanks for needful post