Click here to Skip to main content
15,895,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am getting a error sometimes when trying to page refresh

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.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: 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.

please tell me what is the reason & what is the solution?
Posted
Updated 7-Feb-14 3:22am
v2
Comments
ZurdoDev 7-Feb-14 9:23am    
As the error says, "Please review the stack trace for more information about the error and where it originated in the code." The error gives a few suggestions. Since you have not shown any of your code or told us anything we can't tell you. There is more than one possible reason for the error.
idenizeni 7-Feb-14 18:12pm    
Is this happening in your development environment or in production? If it's happening in development then I wouldn't worry too much about it IF while you are testing you re-compile your application and then try doing a page post-back from a page that was loaded before the recompile.
ZurdoDev 7-Feb-14 19:55pm    
It appears you replied to my comment instead of adding a comment to the question.
idenizeni 7-Feb-14 20:39pm    
Crap, I sure did. Thanks.
idenizeni 7-Feb-14 20:40pm    
Is this happening in your development environment or in production? If it's happening in development then I wouldn't worry too much about it IF while you are testing you re-compile your application and then try doing a page post-back from a page that was loaded before the recompile.

1 solution

XML
<system.web>
<pages enableViewStateMac="false" />
</system.web>

Also tried the following on the page.

<pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode ="Never" />


or you can follow this link

http://forums.asp.net/t/1485987.aspx?Validation+of+viewstate+MAC+failed[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900