ValidateAntiForgeryTokenAttribute Class

Specifies that the class or method that this attribute is applied validates the anti-forgery token. If the anti-forgery token is not available, or if the token is invalid, the validation will fail and the action method will not execute.

Namespace
Microsoft.AspNetCore.Mvc
Assemblies
  • Microsoft.AspNetCore.Mvc.ViewFeatures

Syntax

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class ValidateAntiForgeryTokenAttribute : Attribute, _Attribute, IFilterFactory, IOrderedFilter, IFilterMetadata
class Microsoft.AspNetCore.Mvc.ValidateAntiForgeryTokenAttribute

Methods

CreateInstance(System.IServiceProvider)
Return type:Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata
public IFilterMetadata CreateInstance(IServiceProvider serviceProvider)

Properties

Microsoft.AspNetCore.Mvc.ValidateAntiForgeryTokenAttribute.IsReusable
Return type:System.Boolean
public bool IsReusable { get; }
Microsoft.AspNetCore.Mvc.ValidateAntiForgeryTokenAttribute.Order
Return type:System.Int32
public int Order { get; set; }