System.Web.HttpException: The viewstate is invalid for this page and might be corrupted

  • Thread starter Thread starter Nicolas LeBlanc
  • Start date Start date
N

Nicolas LeBlanc

I've seen several message on newsgroup, but none helped me fixed this damned
problem.

I am not on a load balancing, and the copy in the server is there for ages,
and yet I receive 10 to 20 times a day an email with the same error
happening in various places of my website..

-------------
System.Web.HttpUnhandledException: Exception of type
System.Web.HttpUnhandledException was thrown. ---> System.Web.HttpException:
The viewstate is invalid for this page and might be corrupted.
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadPageViewState()
at System.Web.UI.Page.ProcessRequestMain()
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionSte
p.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
 
I had the same problem while developing pages for a Pocket PC
application.

Try setting the enableViewStateMac="False" in your .aspx page.

Make sure you actually include it in the page as the default for this
property seems to be true. (Can either manually include it or change
the property to true and then back to false.)

I can now leave ViewState on and all works ok.

Hope this helps.
 
This might work, but I'd still like to know what it does...

First thing you see when you look for enableViewStateMac in MSDN is:

This member supports the .NET Framework infrastructure and is not intended
to be used directly from your code.

Without any other explanation!
 
Back
Top