Posts Tagged ‘Viewstate MAC failed’

This is not the first time I have faced this error. I have faced this issue many times in my development career. However, today I got this error on one of my developed live site and hence I have decided to make a post.

The full message of this error reads “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.

This is a common error which can be found on IE 6 or lower version browsers, when any web page gets idle for more than 20 minutes or so.

To resolve this issue, only you need to do is to set the page directive in your web.config file with following attributes.

<pages enableEventValidation=”false” validateRequest=”false” viewStateEncryptionMode=”Never” enableViewStateMac=”false”>

Advertisements