Can you describe different types of action filters in brief provided in ASP.NET MVC?

Can you describe different types of action filters in brief provided in ASP.NET MVC?



There are three types of action filters in ASP.NET MVC.

Authorization Filter :

-This filter is responsible for the execution of an action method.

-For example AuthorizeAttribute class is an authorization filter.
Result Filter:

-It wraps execution of the ActionResult object.

-This filter is responsible for the processing of the result in the case if any modification is required.

-For example OutputCacheAttribute class is a result filter.

Execution Filter:

-This filer is executed when any unhandled exception is occurred in action method from the authorization filters to execution of the result.

-We can use Exception filters for logging or displaying an error page.

-For example HandleErrorAttribute class is an exception filter.
Post your comment