Wednesday, February 23, 2011

validation of viewstate mac failed in asp.net

Before some days the error "Validation of viewstate MAC failed" became my great enemy.
I done lot's of googling to resolve the problem.
I found some good links in which they show some ways to prevent this error one of them is
http://blogs.msdn.com/b/tom/archive/2008/03/14/validation-of-viewstate-mac-failed-error.aspx
Hard luck with me, i tried tips shown in above link which did not work for me, finally after lots of efforts i found the root cause for that error. My all websites were hosted on shared server and they did not alocated dedicated application pool, so most of web sites were on default application pool and hosting people has done setting which recycles that pool every 5 minutes. so when the page got post back after interval of more than 5 minutes application pool get recycled and server raise above error
Validation of viewstate MAC failed.

So finally we decided to buy a dedicated server for our websites and i set dedicated application pool for each website with proper settings so that it does not recycled every 5 minutes.

Finally i got the solution for above error and now me and our clients are happy.


Resources : Asp.net, c#, mysql, iis6.0

No comments:

Post a Comment