O'Reilly logo

ASP.NET MVC 2 in Action by Matthew Hinze, Eric Hexter, Jimmy Bogard, Ben Scheirman, Jeffrey Palermo

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

Chapter 19. Lightweight controllers

This chapter covers

  • Using lightweight controllers to simplify programming
  • Managing common view data without filter attributes
  • Deriving action results to apply common behavior
  • Using an application bus

Do you remember those swollen and unwieldy Page_Load methods in Web Forms? Those methods can quickly grow out of control and stage a revolt against your code base.

Controller actions are dangerous too. Nestled snugly between the model and view, controllers are an easy place to put decision-making code, and they’re often mistaken for a good place to put that logic. And it’s quite convenient, at first. It just takes two lines of code to build a select list in an action method. And adding a filter attribute ...

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