I was receiving following error message constantly in my error log.
Invalid viewstate. Client IP: 127.0.0.1 Port: User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; FDM; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729; 6696076703) ViewState: /wEPDwULLTE0NTg5OTI1MzJkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYCBRZjdGwwMCRDQyRjaGtSZW1lbWJlck1lBRZjdGwwMCRDQyRjaGtUZXJtc09mVXNl4IYD7Rs56CiQOVAEKcORk75X2xw= Referer: http://localhost:56095/HotLinks.aspx Path: /HotLinks.aspx
System.Web.HttpException: Unable to validate data. at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
Cause of this error:
My web application has multiple forms, and from each form if user wants to post feedback and if he is anonymous user, he is redirected to login form.
To improve performance of web application i was using Server.Transfer to redirect anonymous user to login form.
As Server.Transfer don't change the url string, so even if user is on login form, it will still displays last url in browser, everything would be fine, until page is postback, if you do so than it would generate invalid viewstate error. As whenever you are doing page postback it needs to have correct url in order to post back to that page. But in this scenario, even though i am doing page postback on login form, its still assumes last page and so it end's up in above error message.
Work Around/Solution/Temporary Fix for Problem:
I couldn't able to find any good solution, but you can change your Server.Transfer call to Response.Redirect to fix the problem and move ahead.
I would update this post if i found any better solution to deal with this situation.