O'Reilly logo

ASP.NET MVC 1.0 Quickly by Maarten Balliauw

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a filter attribute

An action filter is an attribute that can be applied to a controller class or an action method. Whenever the controller or action method is called, the action filter will be triggered both before and after the execution. Typically, action filters are used for solving problems that can occur in more than one class—the so called cross-cutting concerns. A typical cross-cutting concern is output caching or authentication—both can be required for more than one action method. More information about action filters can be found in Chapter 4, Components in the ASP.NET MVC Framework.

One cross-cutting concern of an action method might be logging. For example, one wants to log when an action was called, and whether its result ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required