FilterAttribute Class
Represents the base class for action and result filter attributes.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
System::Attribute
System.Web.Mvc::FilterAttribute
System.Web.Mvc::ActionFilterAttribute
System.Web.Mvc::AuthorizeAttribute
System.Web.Mvc::ChildActionOnlyAttribute
System.Web.Mvc::HandleErrorAttribute
System.Web.Mvc::OverrideActionFiltersAttribute
System.Web.Mvc::OverrideAuthenticationAttribute
System.Web.Mvc::OverrideAuthorizationAttribute
System.Web.Mvc::OverrideExceptionFiltersAttribute
System.Web.Mvc::OverrideResultFiltersAttribute
System.Web.Mvc::RequireHttpsAttribute
System.Web.Mvc::ValidateAntiForgeryTokenAttribute
System.Web.Mvc::ValidateInputAttribute
| Name | Description | |
|---|---|---|
![]() | FilterAttribute() | Initializes a new instance of the FilterAttribute class. |
| Name | Description | |
|---|---|---|
![]() | AllowMultiple | Gets or sets a value that indicates whether more than one instance of the filter attribute can be specified. |
![]() | Order | Gets or sets the order in which the action filters are executed. |
![]() | TypeId | (Inherited from Attribute.) |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | (Inherited from Attribute.) |
![]() | Finalize() | (Inherited from Object.) |
![]() | GetHashCode() | (Inherited from Attribute.) |
![]() | GetType() | (Inherited from Object.) |
![]() | IsDefaultAttribute() | (Inherited from Attribute.) |
![]() | Match(Object^) | (Inherited from Attribute.) |
![]() | MemberwiseClone() | (Inherited from Object.) |
![]() | ToString() | (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | _Attribute::GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) | (Inherited from Attribute.) |
![]() ![]() | _Attribute::GetTypeInfo(UInt32, UInt32, IntPtr) | (Inherited from Attribute.) |
![]() ![]() | _Attribute::GetTypeInfoCount(UInt32) | (Inherited from Attribute.) |
![]() ![]() | _Attribute::Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) | (Inherited from Attribute.) |
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.
.jpeg?cs-save-lang=1&cs-lang=cpp)
.jpeg?cs-save-lang=1&cs-lang=cpp)
.jpeg?cs-save-lang=1&cs-lang=cpp)
.jpeg?cs-save-lang=1&cs-lang=cpp)
.jpeg?cs-save-lang=1&cs-lang=cpp)