Article ID: 831150 - Last Review: April 7, 2006 - Revision: 4.2 The "Viewstate is invalid for this page" error message does not provide sufficient information to troubleshoot the issue
For a Microsoft .NET Framework 1.0 version of this article, see 832183
(http://support.microsoft.com/kb/832183/
)
.
On This PageSUMMARYBecause View State is stored in a hidden field on a Web page, it is vulnerable to tampering when data is being transferred between the client and the server. To help make View State more secure, ASP.NET validates View State to verify that it came from the correct page. If ASP.NET cannot validate View State, ASP.NET returns a message to the client browser that states that "viewstate is invalid for this page and might be corrupted." However, the message does not describe why View State is not valid. For more information about View State, see "" in the "More Information" section of this article. RESOLUTIONAlthough this article offers a hotfix, this hotfix does not fix View State errors. This hotfix provides additional information to help you troubleshoot View State errors. Important This hotfix contains two types of packages: a Microsoft Windows Installer package, and an Optional Component Manager (OCM) package. If you use Microsoft Windows Server 2003, you must specify that you need the Windows Server 2003 (OCM) update because Windows Server 2003 File Protection monitors the Microsoft .NET Framework 1.1 files. If you use an operating system other than Windows Server 2003, you must use the Windows Installer package. Hotfix informationA supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft .NET Framework 1.1 service pack that contains this hotfix.To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site: http://support.microsoft.com/contactus/?ws=support
(http://support.microsoft.com/contactus/?ws=support)
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.Hotfix file informationThe English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.Date Time Version Size File name --------------------------------------------------------------------------------------------- 13-Nov-2003 03:16 1.1.4322.969 258,048 Aspnet_isapi.dll 13-Nov-2003 03:16 1.1.4322.969 20,480 Aspnet_regiis.exe 13-Nov-2003 03:16 1.1.4322.969 32,768 Aspnet_state.exe 13-Nov-2003 03:16 1.1.4322.969 32,768 Aspnet_wp.exe 16-May-2003 00:49 33,522 Installpersistsqlstate.sql 16-May-2003 00:49 34,150 Installsqlstate.sql 13-Nov-2003 03:06 1.1.4322.969 94,208 Perfcounter.dll 13-Nov-2003 17:38 1.1.4322.969 1,220,608 System.dll 13-Nov-2003 17:38 1.1.4322.969 241,664 System.messaging.dll 13-Nov-2003 17:38 1.1.4322.969 323,584 System.runtime.remoting.dll 13-Nov-2003 17:38 1.1.4322.969 131,072 System.runtime.serialization.formatters.soap.dll 13-Nov-2003 17:39 1.1.4322.969 1,257,472 System.web.dll 13-Nov-2003 17:38 1.1.4322.969 819,200 System.web.mobile.dll 13-Nov-2003 17:38 1.1.4322.969 569,344 System.web.services.dll 13-Nov-2003 17:39 1.1.4322.969 1,339,392 System.xml.dll 13-Nov-2003 03:11 14,472 Webuivalidation.js Hotfix detailsThis hotfix causes the View State error messages to contain more information. After you apply this hotfix, the View State error message title becomes "Unable to Validate Data." The new error message format does not describe exactly what the problem is. However, this error message provides more information than the earlier error message format.Note To obtain more information about the status of your View State, you can run the View State that appears in the error message through a third-party View State decoder. This hotfix sets the InnerException property on the HttpException object so that you can use the Application_Error method to log the underlying exception. Make sure that you recursively log all InnerException property errors. This hotfix adds the following information to the error message for View State errors:
If the error occurs during deserialization, this hotfix adds the LosFormater token, the _deserializationData token, and the position where the error occurred to the error message. In most cases, if the View State data has been truncated, the View State feature will experience a FormatException error in the FromBase64String method, and you receive the following error message: Invalid length for a Base-64 char array View State error message before you apply this hotfixServer Error in '/ViewState' Application. System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +151
System.Web.UI.Page.LoadPageViewState() +18 System.Web.UI.Page.ProcessRequestMain() +423 View State error message after you apply this hotfixServer Error in '/ViewState' Application. System.Web.Configuration.MachineKey.GetDecodedData(Byte[] buf, String strModifier) +866 [HttpException (0x80004005): Authentication of viewstate failed. 1) If this is a cluster, edit <machineKey> configuration so all servers use the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. 2) Viewstate can only be posted back to the same page. 3) The viewstate for this page might be corrupted.]
System.Web.UI.LosFormatter.Deserialize(String input) +44 System.Web.UI.LosFormatter.Deserialize(String input) +102 [HttpException (0x80004005): The viewstate is invalid for this page and might be corrupted.
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +101 Client IP: 127.0.0.1 Port: 1095 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705) ViewState: dDwzNDM3NTkwMzg7dDw7bDxpPDEPGk8MT47PjtsPHQ8QDA8cDxwPGw8RGF0YUt Path: /connect2access/webform1.aspx.] System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +435
System.Web.UI.Page.LoadPageViewState() +16 System.Web.UI.Page.ProcessRequestMain() +439 STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. MORE INFORMATION
For additional information about the terminology that is used to describe Microsoft product updates, click the following article number to view the article in the Microsoft Knowledge Base:
824684
(http://support.microsoft.com/kb/824684/
)
Description of the standard terminology that is used to describe Microsoft software updates
Description of View StateASP is stateless. Each time that an application makes a round trip from the server to the client, the data is not intrinsically saved. Each time that a Web page is posted to the server, the page is re-created. This behavior causes all information that is associated with the page, and with the controls on the page, to be lost for each round trip. For example, if a user types information in a text box, that information is lost in the round trip from the browser or from the client device to the server.ASP.NET is also stateless. However, ASP.NET has a new feature, View State, that you can use to preserve data between round trips to and from the server. View State automatically preserves property values of the page, and the values of all controls on the page, between round trips. View State is maintained as a hidden field on the page. You can use View State to store your own page-specific values across round trips when the page posts back to itself. For example, if your application is maintaining user-specific information, you can store this user-specific information in View State. User-specific information is information that is used on the page but that is not necessarily a part of any control. back to the "Summary" section APPLIES TO
| Article Translations
|

Back to the top
