Caution
This method is deprecated. Use the AntiForgeryToken() method instead. To specify a custom domain for the generated cookie, use the configuration element. To specify custom data to be embedded within the token, use the static AntiForgeryConfig.AdditionalDataProvider property.
Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. The field value is generated using the specified salt value, domain, and path.
[System.Obsolete("This method is deprecated. Use the AntiForgeryToken() method instead. To specify a custom domain for the generated cookie, use the 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
Parameters
The salt value, which can be any non-empty string.
domain
The application domain.
The virtual path.
Returns
The generated form field (anti-forgery token).
Applies to