Chapter 13. Filters

Filters inject extra logic into the request processing pipeline. They provide a simple and elegant way to implement cross-cutting concerns. This term refers to functionality that is used all over an application and doesn't fit neatly into any one place, so it would break the separation of concerns pattern. Classic examples of cross-cutting concerns are logging, authorization, and caching.

Filters are so-called because this term is used for the same facility in other web application frameworks, including Ruby on Rails. However, MVC Framework filters are entirely different from the ASP.NET platform's Request.Filter and Response.Filter objects, which perform transformations on the request and response streams (an advanced and infrequently ...

Get Pro ASP.NET MVC 3 Framework, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.