Share via


ValidateFormDigest Method

The ValidateFormDigest method of the SPWeb class validates the form digest control used in the current request.

Return Value

true if the form digest control is valid, otherwise, false.

Remarks

The ValidateFormDigest method can be used to explicitly check the security validation used in an ASPX page. This method searches the ASPX page for the INPUT control that is named __REQUESTDIGEST and verifies that the message digest contained in the control is valid. This method can be used in code that runs on a second ASPX page to which the first ASPX page posts, or on the first page if a second page is not involved. This method assumes that a FormDigest control exists on the ASPX page making the post.

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security