Generates a hidden form field (anti-forgery token) that is validated when the form is submitted.
|
| Name | Description |
|
AntiForgeryToken()()()
|
Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. (Inherited from HtmlHelper.) |
|
AntiForgeryToken(String)
|
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. (Inherited from HtmlHelper.) |
|
AntiForgeryToken(String, String, String)
|
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. (Inherited from HtmlHelper.) |
Top
The anti-forgery token can be used to help protect your application against cross-site request forgery. To use this feature, call the AntiForgeryToken method from within your form, and add the ValidateAntiForgeryTokenAttribute to the action method you want to protect.
Reference