ASP.NET MVC Filters


aspnetmvc.png


ASP.NET MVC Filters

ASP.NET MVC provide filters to execute code logic before and after controller action execution. Pre-action and post-action behaviour are added to controller action method by filters. Custom filters creation depends on inheriting and overriding methods of ASP.NET MVC filter attribute class or by implementing filter interface.


Various type of filters :-

  • Authorization filters :- This filter implements IAuthorizationFilter interface and when used with controller action makes security decision to execute action method if user is an authorized user else action method will not be executed.
  • Action filters :- This filter implements IActionFilter interface. OnActionExecuting and OnActionExecuted are two methods provided by IActionFilter. OnActionExecuting is executed before action method while OnActionExecuted is executed after action method.

Read more about ASP.NET MVC Filters visit FindNerd.

Comments

Popular posts from this blog

7 #Best #Youtube Alternatives for Video #Marketing

Top 7 #MarketingAutomation Tools To Grow #Business

Top 8 Guerrilla Marketing Strategies to Follow for Attracting Customers