Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

FilterAttribute Class

 

Represents the base class for action and result filter attributes.

Namespace:   System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)


[AttributeUsageAttribute(AttributeTargets::Class | AttributeTargets::Method, 
	Inherited = true, AllowMultiple = false)]
public ref class FilterAttribute abstract : Attribute, IMvcFilter

NameDescription
System_CAPS_protmethodFilterAttribute()

Initializes a new instance of the FilterAttribute class.

NameDescription
System_CAPS_pubpropertyAllowMultiple

Gets or sets a value that indicates whether more than one instance of the filter attribute can be specified.

System_CAPS_pubpropertyOrder

Gets or sets the order in which the action filters are executed.

System_CAPS_pubpropertyTypeId

(Inherited from Attribute.)

NameDescription
System_CAPS_pubmethodEquals(Object^)

(Inherited from Attribute.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Attribute.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodIsDefaultAttribute()

(Inherited from Attribute.)

System_CAPS_pubmethodMatch(Object^)

(Inherited from Attribute.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

Typically, you create a filter by creating an attribute class that inherits from the abstract FilterAttribute class. Some built-in action filters, such as AuthorizeAttribute and HandleErrorAttribute, inherit from the FilterAttribute class. Other action filters, such as OutputCacheAttribute, inherit from the abstract ActionFilterAttribute class, which enables the action filter to run either before or after the action method runs.

You can use filter attributes to mark any action method or controller. If the attribute marks a controller, the filter applies to all action methods in that controller.

For more information about how to use attributes, see .

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2015 Microsoft