only My site

Sunday, August 19, 2012

Sharepoint : FormDigest Control and SPUtility.ValidateFormDigest()

<SharePoint:FormDigest runat="server"/>
This control inserts the security validation key within the form of an .aspx page

<form id="Form1" method="post" runat="server">
   <SharePoint:FormDigest runat="server"/>
   <asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 282px; POSITION: absolute;
      TOP: 282px" runat="server" Text="Button"></asp:Button>
</form>

SPUtility.ValidateFormDigest()
Validates the form digest control that is used in the current request.

Remark
If the method that is passed to the RunWithElevatedPrivileges method includes a write operation, either of theSPUtility.ValidateFormDigest() or SPWeb.ValidateFormDigest() methods should be called before a call is made toRunWithElevatedPrivileges.
 

No comments: