Microsoft KB Archive/867472

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

Article ID: 867472

Article Last Modified on 1/12/2007

-

APPLIES TO


 * Microsoft ASP.NET 1.1
 * Microsoft ASP.NET 1.0

-





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.



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.



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:

http://msdn.microsoft.com/msdnmag/issues/05/11/SecureWebApps/default.aspx

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[&quot;_ViewState&quot;]; }

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

VB.NET

Protected Overrides Function LoadPageStateFromPersistenceMedium As Object Return Session(&quot;_ViewState&quot;) End Function

Protected Overrides Sub SavePageStateToPersistenceMedium(ByVal viewState As Object) Session(&quot;_ViewState&quot;) = viewState End Sub

