Solved

Validation of viewstate MAC failed

Posted on 2011-03-02
11
890 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
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.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
asp day pilot 3 19
Add different cell to otherwise similiar row 4 39
Batch file or script with password 22 44
Client Validating 2 date fields, required & comparison 1 26
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

773 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