Fixing the Validation of viewstate MAC failed error issue.
This is just a quickie to see if that helps anybody. The GridView in GeoTwitter had a problem as was using the DataKeyNames. I was getting the error on the viewstate MAC failed error. Looks like adding the code below on the web.config fix the issue.
<pages enableEventValidation="false" viewStateEncryptionMode="Never">
The problem now is I don’t have a validation for the viewstate, that’s a security problem in my modest opinion, I found this resource below that help me to understand a little bit more what the MAC failed error is:
Great blog post found here: Resources to fix the issue.
Hope it helps you too.
Cheers
Al
Posted from http://weblogs.asp.net/albertpascual



Comments
brad said on 8.12.2008 at 12:35 AM
There are two things that can cause the validation to fail. The first is that the validation element ends up at the bottom of the page and the thing tries to post back before the page has loaded that far. The other is more common and happens when the app pool gets recycled. The encryption key is generated and used once per app pool cycle. You can force the key to a static value by setting machineKey in the web.confg.