2

I'm facing this problem on server and localhost both place

Error:

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

enter image description here

Hardik Vinzava
  • 968
  • 10
  • 22
Sunil Acharya
  • 1,153
  • 5
  • 22
  • 39
  • 1
    possible duplicate of [Asp.net Validation of viewstate MAC failed](http://stackoverflow.com/questions/5840899/asp-net-validation-of-viewstate-mac-failed) – Max Al Farakh Apr 12 '14 at 06:39
  • Levi has the right answer - There is a KB article that addresses your question at http://support.microsoft.com/kb/2915218 – RickAndMSFT Apr 15 '14 at 23:02

3 Answers3

0

To resolve this issue add following line in your web.config file under <system.web>

<machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="SHA1" decryption="Auto>

Also read about web garden vs web farm here

Thanks,
Ashish
Soigne Technologies Pvt Ltd

0

In your aspx page, keep the EnableViewStateMac value as false. This will be in the first line of your aspx page. For example

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableViewStateMac="false"%>
  • Hello, I'm tried by using this tag in config and aspx page all viewstate are stop working... please give me other solution... – Sunil Acharya Apr 16 '14 at 05:59
0

Two option

  1. Either Disable ViewStateMac equal to false

  2. Or Configure MachineKey in Web.config ( It should not be auto generate)

dotnetstep
  • 17,065
  • 5
  • 54
  • 72
  • How can i disable this ViewStateMac ? After disable should my ViewState tag will work ? – Sunil Acharya Apr 14 '14 at 13:28
  • Yes. Answer of this question may help you to disable for your application. http://stackoverflow.com/questions/2645468/how-to-disable-view-state-mac-globally – dotnetstep Apr 14 '14 at 13:41