SPWeb.ValidateFormDigest Method
Validates the form digest control that is used in the current request.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
The ValidateFormDigest method can be used to explicitly check the security validation that is 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 that is making the post.
Either SPUtility.ValidateFormDigest() or SPWeb.ValidateFormDigest() should be called before a call of RunWithElevatedPrivileges, if the method passed to the RunWithElevatedPrivileges includes any write operations.