System.Web.UI.ViewStateException: Invalid viewstate

sooraj.e picture sooraj.e · Nov 24, 2011 · Viewed 42.9k times · Source

I have a web application developed in ASP.net & C#. I also use Telerik ASP.NET AJAX for web UI. Application throws an exception (System.Web.UI.ViewStateException: Invalid viewstate) in production server. It works fine in test server. And this error is thrown randomly.

System.Web.UI.ViewStateException: Invalid viewstate. 
Client IP: x.x.x.x
Port: xxxxx
Referer: http://webaddress/Page.aspx
Path: /Page.aspx
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; CMNTDF; BRI/1; InfoPath.3; BRI/2; .NET4.0C)
ViewState: /wEPDwUILT ... [further contents omitted for this question]

Answer

TBohnen.jnr picture TBohnen.jnr · Nov 24, 2011

There are a host of reasons why this could occur, a common one being worker process recycling/Application Pool Recycling on your IIS server.

Have a look at the below articles to try and debug why exactly it is occuring with you:

http://support.microsoft.com/kb/555353

More specifically to determine the error have a look at the "Determine exactly what exception occurs when you receive the error message" part in the below link:

http://support.microsoft.com/kb/829743