0% found this document useful (0 votes)
17 views1 page

ASPDotNet MVC Filters

Action filters are attributes that can modify how controller actions execute. There are four types of filters: authorization, action, result, and exception filters. Filters execute in a specific order, like authorization before action and exception after others.

Uploaded by

OneManGarage OMG
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

ASPDotNet MVC Filters

Action filters are attributes that can modify how controller actions execute. There are four types of filters: authorization, action, result, and exception filters. Filters execute in a specific order, like authorization before action and exception after others.

Uploaded by

OneManGarage OMG
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Action Filters

An action filter is an attribute that you can apply to a controller action or an


entire controller that modifies the way in which the action is executed. The
ASP.NET MVC framework includes several action filters −

OutputCache − Caches the output of a controller action for a specified amount of


time.

HandleError − Handles errors raised when a controller action is executed.

Authorize − Enables you to restrict access to a particular user or role.

Types of Filters
The ASP.NET MVC framework supports four different types of filters −

Authorization Filters − Implements the IAuthorizationFilter attribute.

Action Filters − Implements the IActionFilter attribute.

Result Filters − Implements the IResultFilter attribute.

Exception Filters − Implements the IExceptionFilter attribute.

Filters are executed in the order listed above. For example, authorization filters
are always executed before action filters and exception filters are always executed
after every other type of filter.

Authorization filters are used to implement authentication and authorization for


controller actions. For example, the Authorize filter is an example of an
Authorization filter.

You might also like