Last post May 15, 2015 07:07 AM by mgebhard
May 15, 2015 05:59 AM|Martin91|LINK
I have a number of product pages which have a data pager control on them. An issue i have found is that if the user leaves the page static for a while (approx 5 minutes) and the comes back to the site then clicks either 'next' or 'previous' etc on the data
pager control the following error occurs;
"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.”
I have done some research into this and have been unable to find a solution, in my web config file i dont have a <machineKey>. The only part of the web config file which could possibly be causing the issue is;
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
Does anyone have any suggestions on how to fix this issue?
May 15, 2015 07:07 AM|mgebhard|LINK
There is a file named machine.config which contains setting for the entire machine.
The machineKey is used to encrypt and decrypt ViewState. By default, the machineKey node is set to automatically generate a validationKey when an application starts or restarts. If the server's machineKey is different than the machineKey used to encrypt ViewState,
the server is unable to decrypt ViewState and you get the error described.
The machineKey can be different for a several reasons. The web application is restarting within the 5 minutes. You're in a load balanced environment and the request whet to a different machine with a different machineKey.
Please see the following MSDN article for more information.