Can you apply an ActionFilter in ASP.NET-MVC on EVERY action
问题 I want to apply an ActionFilter in ASP.NET MVC to EVERY action I have in my application - on every controller. Is there a way to do this without applying it to every single ActionResult method ? 回答1: Yes, you can do this but it's not the way it works out of the box. I did the following: Create a base controller class and have all of your controllers inherit from it Create an action filter attribute and have it inherit from FilterAttribute and IActionFilter Decorate your base controller class