Advertise with us

What are the Filters in MVC ?

Last updated:9/23/2020 2:10:28 PM

1 Answers

Shrikant Mishra
Shrikant Mishra

At times you want to execute some logic either before the execution of the action method or after the execution. You can use Action Filter for such kind of scenario. These Filters define the logic which is executed before or after the execution of the action method. The Action Filters are attributes which we can apply to the action methods. Following are the MVC action filter types:

  • Authorization filter (implements IAuthorizationFilter)
  • Action filter (implements IActionFilter)
  • Result filter (implements IResultFilter)
  • Exception filter (implementsIExceptionFilter attribute)

Answer