Solved

Validation of viewstate MAC failed

Posted on 2011-03-02
11
892 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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