Table of Contents

Class ValidateAntiForgeryTokenAttribute

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

Represents an attribute that is used to prevent forgery of a request.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class ValidateAntiForgeryTokenAttribute : FilterAttribute, IMvcFilter, IAuthorizationFilter
Inheritance
ValidateAntiForgeryTokenAttribute
Implements
Inherited Members

Constructors

ValidateAntiForgeryTokenAttribute()

Initializes a new instance of the ValidateAntiForgeryTokenAttribute class.

public ValidateAntiForgeryTokenAttribute()

Methods

OnAuthorization(AuthorizationContext)

Called when authorization is required.

public void OnAuthorization(AuthorizationContext filterContext)

Parameters

filterContext AuthorizationContext

The filter context.

Exceptions

ArgumentNullException

The filterContext parameter is null.