Solved

Validation of viewstate MAC failed

Posted on 2011-03-02
11
893 Views
Last Modified: 2012-06-21
Hi,

this error is making me crazy:

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 tried the work around like enableViewState="false" viewStateEncryptionMode="Never", even i did not use the DataKeyNames property of the ListView.

I am having Asp.Net 3.5 and working in C# and getting this error in LIVE environment.

Please suggest any proven/used method to sort out this issue.

Thanks
Kaushal Arora
0
Comment
Question by:Kaushal Arora
11 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 35015799
Is you app actually running in a cluster/farm environment?
0
 
LVL 12

Author Comment

by:Kaushal Arora
ID: 35016046
No It is not running in a cluster/farm environment. I am having a dedicated server for the application.
0
 
LVL 1

Expert Comment

by:designweboxx
ID: 35016131
Does this error only happen in IE or other Browsers as well?

I had this issue when I used jQuery to update some areas inside a web form by AJAX (only in IE, all other Browsers worked fine). Moving the AJAX-modified areas out of the <form runat=server>-tag solved the problem. Not the best solution, but in my case it worked.

Still looking for a more elegant solution though...
0
Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

 
LVL 12

Author Comment

by:Kaushal Arora
ID: 35016332
I am getting this error in all the browsers, not only in IE.
Also the error is coming on both type of pages that is where AJAX toolkit is used and where it is not.

0
 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 35146577
try to add this string in <system.web> section of your web.config file :
<pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode ="Never" />
for fix "Validation of viewstate MAC failed" error.


also see this

http://forums.asp.net/t/955145.aspx?PageIndex=20
0
 
LVL 12

Author Comment

by:Kaushal Arora
ID: 35146672
@king2002: I have already tried these things.

One thing more which i have observed is that mainly this error comes when my page is idle for some time and user click on any link.
0
 
LVL 16

Accepted Solution

by:
Kamal Khaleefa earned 500 total points
ID: 35146813
The reason for this error is validation of Viewstate failing because of different value of key for encryption/decryption across different server on farm. Below link provide good explanation of this error and possible resolution for the same.
http://a2zmenu.com/AspNet/Validation-of-viewstate-MAC-failed.aspx
0
 
LVL 12

Author Comment

by:Kaushal Arora
ID: 35147548
I will test the second method given in the link and will revert you soon.

Thanks for the help.
0
 
LVL 12

Author Closing Comment

by:Kaushal Arora
ID: 35163821
Thanks
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question