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 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.