Share via


HtmlHelper.AntiForgeryToken Méthode

Définition

Surcharges

AntiForgeryToken()

Génère un champ de formulaire caché (jeton anti-contrefaçon) validé lorsque le formulaire est envoyé.

AntiForgeryToken(String)
Obsolète.

Génère un champ de formulaire caché (jeton anti-contrefaçon) validé lorsque le formulaire est envoyé. La valeur de champ est générée à l'aide de la valeur salt spécifiée.

AntiForgeryToken(String, String, String)
Obsolète.

Génère un champ de formulaire caché (jeton anti-contrefaçon) validé lorsque le formulaire est envoyé. La valeur de champ est générée à l'aide de la valeur salt, du domaine et du chemin d'accès spécifiés.

AntiForgeryToken()

Génère un champ de formulaire caché (jeton anti-contrefaçon) validé lorsque le formulaire est envoyé.

public System.Web.Mvc.MvcHtmlString AntiForgeryToken ();
member this.AntiForgeryToken : unit -> System.Web.Mvc.MvcHtmlString
Public Function AntiForgeryToken () As MvcHtmlString

Retours

Champ de formulaire généré (jeton anti-contrefaçon).

S’applique à

AntiForgeryToken(String)

Attention

This method is deprecated. Use the AntiForgeryToken() method instead. To specify custom data to be embedded within the token, use the static AntiForgeryConfig.AdditionalDataProvider property.

Génère un champ de formulaire caché (jeton anti-contrefaçon) validé lorsque le formulaire est envoyé. La valeur de champ est générée à l'aide de la valeur salt spécifiée.

[System.Obsolete("This method is deprecated. Use the AntiForgeryToken() method instead. To specify custom data to be embedded within the token, use the static AntiForgeryConfig.AdditionalDataProvider property.", true)]
public System.Web.Mvc.MvcHtmlString AntiForgeryToken (string salt);
member this.AntiForgeryToken : string -> System.Web.Mvc.MvcHtmlString
Public Function AntiForgeryToken (salt As String) As MvcHtmlString

Paramètres

salt
String

Valeur salt qui peut correspondre à toute chaîne non vide.

Retours

Champ de formulaire généré (jeton anti-contrefaçon).

Attributs

S’applique à

AntiForgeryToken(String, String, String)

Attention

This method is deprecated. Use the AntiForgeryToken() method instead. To specify a custom domain for the generated cookie, use the <httpCookies> configuration element. To specify custom data to be embedded within the token, use the static AntiForgeryConfig.AdditionalDataProvider property.

Génère un champ de formulaire caché (jeton anti-contrefaçon) validé lorsque le formulaire est envoyé. La valeur de champ est générée à l'aide de la valeur salt, du domaine et du chemin d'accès spécifiés.

[System.Obsolete("This method is deprecated. Use the AntiForgeryToken() method instead. To specify a custom domain for the generated cookie, use the <httpCookies> configuration element. To specify custom data to be embedded within the token, use the static AntiForgeryConfig.AdditionalDataProvider property.", true)]
public System.Web.Mvc.MvcHtmlString AntiForgeryToken (string salt, string domain, string path);
member this.AntiForgeryToken : string * string * string -> System.Web.Mvc.MvcHtmlString
Public Function AntiForgeryToken (salt As String, domain As String, path As String) As MvcHtmlString

Paramètres

salt
String

Valeur salt qui peut correspondre à toute chaîne non vide.

domain
String

Domaine d'application.

path
String

Chemin d'accès virtuel.

Retours

Champ de formulaire généré (jeton anti-contrefaçon).

Attributs

S’applique à