• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 910
  • Last Modified:

Validation of viewstate MAC failed

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
Kaushal Arora
Asked:
Kaushal Arora
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
Is you app actually running in a cluster/farm environment?
0
 
Kaushal AroraTechnical AnalystAuthor Commented:
No It is not running in a cluster/farm environment. I am having a dedicated server for the application.
0
 
designweboxxCommented:
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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
Kaushal AroraTechnical AnalystAuthor Commented:
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
 
Kamal KhaleefaInformation Security SpecialistCommented:
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
 
Kaushal AroraTechnical AnalystAuthor Commented:
@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
 
Kamal KhaleefaInformation Security SpecialistCommented:
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
 
Kaushal AroraTechnical AnalystAuthor Commented:
I will test the second method given in the link and will revert you soon.

Thanks for the help.
0
 
Kaushal AroraTechnical AnalystAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now