SPWeb.ValidateFormDigest 方法

Validates the form digest control that is used in the current request.

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Function ValidateFormDigest As Boolean
用法
Dim instance As SPWeb
Dim returnValue As Boolean

returnValue = instance.ValidateFormDigest()
public bool ValidateFormDigest()

返回值

类型:System.Boolean
true if the form digest control is valid, otherwise, false.

备注

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.

另请参阅

引用

SPWeb 类

SPWeb 成员

Microsoft.SharePoint 命名空间