HtmlHelper.AntiForgeryToken Método

Definición

Sobrecargas

AntiForgeryToken()

Genera un campo de formulario oculto (token antifalsificación) que se valida cuando se envía el formulario.

AntiForgeryToken(String)
Obsoletos.

Genera un campo de formulario oculto (token antifalsificación) que se valida cuando se envía el formulario. El valor de campo se genera mediante el valor salt especificado.

AntiForgeryToken(String, String, String)
Obsoletos.

Genera un campo de formulario oculto (token antifalsificación) que se valida cuando se envía el formulario. El valor de campo se genera mediante el valor salt, el dominio y la ruta de acceso especificados.

AntiForgeryToken()

Genera un campo de formulario oculto (token antifalsificación) que se valida cuando se envía el formulario.

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

Devoluciones

Campo de formulario generado (token antifalsificación).

Se aplica a

AntiForgeryToken(String)

Precaución

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.

Genera un campo de formulario oculto (token antifalsificación) que se valida cuando se envía el formulario. El valor de campo se genera mediante el valor salt especificado.

[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

Parámetros

salt
String

Valor salt, que puede ser cualquier cadena no vacía.

Devoluciones

Campo de formulario generado (token antifalsificación).

Atributos

Se aplica a

AntiForgeryToken(String, String, String)

Precaución

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.

Genera un campo de formulario oculto (token antifalsificación) que se valida cuando se envía el formulario. El valor de campo se genera mediante el valor salt, el dominio y la ruta de acceso especificados.

[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

Parámetros

salt
String

Valor salt, que puede ser cualquier cadena no vacía.

domain
String

Dominio de aplicación.

path
String

Ruta de acceso virtual.

Devoluciones

Campo de formulario generado (token antifalsificación).

Atributos

Se aplica a