AntiForgery.Validate AntiForgery.Validate AntiForgery.Validate Method

Definition

Overloads

Validate() Validate() Validate()

Validates that input data from an HTML form field comes from the user who submitted the data.

Validate(String, String) Validate(String, String) Validate(String, String)

Validates that input data from an HTML form field comes from the user who submitted the data.

Validate(HttpContextBase, String) Validate(HttpContextBase, String) Validate(HttpContextBase, String)

Validates that input data from an HTML form field comes from the user who submitted the data and lets callers specify additional validation details.

Validate() Validate() Validate()

Validates that input data from an HTML form field comes from the user who submitted the data.

public static void Validate ();
static member Validate : unit -> unit
Public Shared Sub Validate ()
Exceptions
System.Web.Helpers.HttpAntiForgeryException System.Web.Helpers.HttpAntiForgeryException System.Web.Helpers.HttpAntiForgeryException

The HTTP cookie token that accompanies a valid request is missing-or-The form token is missing.-or-The form token value does not match the cookie token value.-or-The form token value does not match the cookie token value.

Validate(String, String) Validate(String, String) Validate(String, String)

Validates that input data from an HTML form field comes from the user who submitted the data.

public static void Validate (string cookieToken, string formToken);
static member Validate : string * string -> unit
Public Shared Sub Validate (cookieToken As String, formToken As String)
Parameters
cookieToken
String String String

The cookie token value.

formToken
String String String

The token form.

Validate(HttpContextBase, String) Validate(HttpContextBase, String) Validate(HttpContextBase, String)

Warning

This API is now obsolete.

Validates that input data from an HTML form field comes from the user who submitted the data and lets callers specify additional validation details.

[System.Obsolete("This method is deprecated. Use the Validate() method instead.", true)]
public static void Validate (System.Web.HttpContextBase httpContext, string salt);
static member Validate : System.Web.HttpContextBase * string -> unit
Public Shared Sub Validate (httpContext As HttpContextBase, salt As String)
Parameters
httpContext
HttpContextBase HttpContextBase HttpContextBase

The HTTP context data for a request.

salt
String String String

An optional string of random characters (such as Z*7g1&p4) that is used to decrypt an authentication token created by the AntiForgery class. The default is null.

Exceptions
System.Web.Helpers.HttpAntiForgeryException System.Web.Helpers.HttpAntiForgeryException System.Web.Helpers.HttpAntiForgeryException

The HTTP cookie token that accompanies a valid request is missing.-or-The form token is missing.-or-The form token value does not match the cookie token value.-or-The form token value does not match the cookie token value.-or-The salt value supplied does not match the salt value that was used to create the form token.

Applies to