Invalid ViewState Error

Posted on 2011-10-14
Medium Priority
Last Modified: 2012-05-12
I'm running IIS 7.0, and .NET 3.5.  My pages will randomly receive the error below.  I have a ScriptManager running on a MasterPage, and and ScriptManagerProxy running on all the pages that use it.  The error will be received several times in a row throughout the day, then I may not see it for days.  The last couple of times it happened after making an update to the site, but that's not always the case.  The error happens on different browsers as well. Is there an easy way to trace it to where the error actually happened?
System.Web.HttpException: Invalid viewstate. at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType) at System.Web.UI.Page.DecryptString(String s) at System.Web.Handlers.ScriptResourceHandler.DecryptParameter(NameValueCollection queryString) at System.Web.Handlers.ScriptResourceHandler.ProcessRequestInternal(HttpResponse response, NameValueCollection queryString, VirtualFileReader fileReader) at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext context) at System.Web.Handlers.ScriptResourceHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Open in new window

Question by:dxproz232
  • 2
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 36968541
LVL 15

Expert Comment

ID: 36968997
add enableviewstatmac="false" to pages element in the web config

Author Comment

ID: 36970077
Looking at that document EaswaranP... Eval we need the viewstate as we use it in the code...
LVL 15

Accepted Solution

Eyal earned 2000 total points
ID: 36970140
didn't wrote EnableViewState = false

EnableViewStateMac - Gets or sets a value indicating whether ASP.NET should run a message authentication check (MAC) on the page's view state when the page is posted back from the client.

Source: http://msdn2.microsoft.com/en-us/library/system.web.ui.page.enableviewstatemac.aspx

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month17 days, 13 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question