A filter's ability to scope it into three levels makes it a powerful feature in ASP.NET MVC applications.
Filters can be applied globally or per-controller or per-action level:
- A filter's written attributes can be applied at any level. A global filter gets applied on every controller or every action if it's not really necessary.
- Controller attribute filters get applied to controller and all its action methods.
- Action attribute filters get applied to particular actions only. This gives more flexibility to apply filters.
- Multiple filters on action execution are determined by the order property. If the same orders arise, execution starts at global level, then controller, and finally at action level.
- When action runs, the order ...