Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

You receive an error message when you try to open a Web page in an ASP.NET application


View products that this article applies to.

The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

↑ Back to the top


Symptoms

When you try to open a Web page in your Microsoft ASP.NET application, you receive the following error:
The view state is invalid for this page, and may be corrupt.

↑ Back to the top


Cause

This problem may occur when you enable cross-site scripting detection on Check Point Firewall on your private network. The cross-site scripting check may corrupt the view state of the ASP.NET application page.

↑ Back to the top


Workaround

To work around this problem, you can disable the cross-site scripting detection or you can store the view state on the server. To disable cross-site scripting detection on your Check Point Firewall-1, see your Check Point Firewall-1 documentation. For more information, visit the following Check Point Web site: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

To store the view state on the server, use the following code sample:
C#:

protected override object LoadPageStateFromPersistenceMedium() { 
   return Session["_ViewState"]; 
}

protected override void SavePageStateToPersistenceMedium(object viewState)
{ 
       Session["_ViewState"] = viewState; 
}


VB.NET

Protected Overrides Function LoadPageStateFromPersistenceMedium() As Object
        Return Session("_ViewState")
End Function

Protected Overrides Sub SavePageStateToPersistenceMedium(ByVal viewState As Object)
        Session("_ViewState") = viewState
End Sub

↑ Back to the top


References

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
829743 Troubleshooting the "View state is invalid" error with ASP.NET

↑ Back to the top


Keywords: KB867472, kbprb

↑ Back to the top

Article Info
Article ID : 867472
Revision : 3
Created on : 1/12/2007
Published on : 1/12/2007
Exists online : False
Views : 336