Chapter 3. The controller in depth

This chapter covers

  • Understanding controller anatomy

  • Leveraging viewless controllers

  • Testing controllers

  • Using form and querystring values

  • Binding action parameter

  • Developing action filters

The focus of the Model-View-Controller pattern is the controller. With this pattern, every request is handled by a controller and rendered by a view. Without the controller, presentation and business logic would move to the view, as we have seen with Web Forms. With the ASP.NET MVC Framework, every request routes to a controller, which is simply a class that implements the IController interface. Microsoft provides the base class System.Web.Mvc.Controller to make creating a controller easy. The controller base class you choose is ...

Get ASP.NET MVC in Action with MvcContrib, NHibernate, and More now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.