What’s the difference between implementing FilterAttribute, IActionFilter and inheriting from ActionFilterAttribute in asp.net mvc 3?

Basically FilterAttribute provides the most low level behaviour of MVC Attributes and implements the IMvcFilter that provides the Order and AllowMultiple properties.

ActionFilterAttribute is the basis for filtering actions and results, since is a implementation of IActionFilter, IResultFilter and inherit from FilterAttribute.

Your MySecondFilterAttribute implementation leads to ActionFilterAttribute without IResultFilter capabilities (OnResultExecuting and OnResultExecuted).

Leave a Comment