ASP.NET MVC in Action
With MvcContrib, NHibernate, and more
Jeffrey Palermo, Ben Scheirman, and Jimmy Bogard
  • August 2009
  • ISBN 9781933988627
  • 392 pages
  • printed in black & white

Shows how to put all the features of ASP.NET MVC together to build a great application.

Phil Haack, Microsoft


ASP.NET MVC 4 in Action is now available.

ASP.NET MVC in Action is a guide to pragmatic MVC-based web development. After a thorough overview, it dives into issues of architecture and maintainability. The book assumes basic knowledge of ASP.NET (v. 3.5) and expands your expertise.

Table of Contents detailed table of contents




about this book

about the authors

about the cover illustration

1. Getting started with the ASP.NET MVC Framework

1.1. Picking apart the default application

1.2. Your first ASP.NET MVC controller from scratch

1.3. Our first view

1.4. Ensuring the application is maintainable

1.5. Testing controller classes

1.6. Summary

2. The model in depth

2.1. Understanding the basics of domain-driven design

2.2. Domain model for this book

2.3. Presentation model

2.4. Working with the model

2.5. Summary

3. The controller in depth

3.1. The controller action

3.2. Simple controllers do not need a view

3.3. Testing controllers

3.4. Simple actions and views

3.5. Working with form values

3.6. Processing querystring parameters

3.7. Binding more complex objects in action parameters

3.8. Options for passing ViewData

3.9. Filters

3.10. Summary

4. The view in depth

4.1. How ASP.NET MVC views differ from Web Forms

4.2. Folder structure and view basics

4.3. Overview of view basics

4.4. Leveraging the view to create dynamic screens

4.5. Summary

5. Routing

5.1. What are routes?

5.2. Designing a URL schema

5.3. Implementing routes in ASP.NET MVC

5.4. Using the routing system to generate URLs

5.5. Creating routes for Code Camp Server

5.6. Testing route behavior

5.7. Using routing with existing ASP.NET projects

5.8. Summary

6. Customizing and extending the ASP.NET MVC Framework

6.1. Extending URL routing

6.2. Creating your own ControllerFactory

6.3. Extending the controller

6.4. Creating a custom view engine

6.5. Customizing Visual Studio for ASP.NET MVC

6.6. Summary

7. Scaling the architecture for complex sites

7.1. Taming large controller actions

7.2. Whipping views into shape

7.3. Using action filters to load common data

7.4. Organizing controllers into areas

7.5. Summary

8. Leveraging existing ASP.NET features

8.1. ASP.NET server controls

8.2. State management

8.3. Tracing and debugging

8.4. Implementing personalization and localization

8.5. Implementing ASP.NET site maps

8.6. Summary


9.1. Diving into AJAX with an example

9.2. AJAX with ASP.NET Web Forms


9.4. Summary

10. Hosting and deployment

10.1. Deployment scenarios

10.2. XCOPY deployment

10.3. Deploying to IIS 7

10.4. Deploying to IIS 6 and earlier

10.5. Automating deployments

10.6. Summary

11. Exploring MonoRail and Ruby on Rails

11.1. MonoRail

11.2. Ruby on Rails

11.3. Summary

12. Best practices

12.1. Controllers


12.3. Routes

12.4. Testing

12.5. Summary

13. Recipes

13.1. jQuery autocomplete text box

13.2. Automatic client-side validation

13.3. Data access with NHibernate

13.4. Designing views with the Spark view engine

13.5. Summary


About the Technology

ASP.NET MVC implements the Model-View-Controller pattern on the ASP.NET runtime. It works well with open source projects like NHibernate, Castle, StructureMap, AutoMapper, and MvcContrib.

What's inside

  • How to effectively perform unit and full-system tests.
  • How to implement dependency injection using StructureMap or Windsor.
  • How to work with the domain and presentation models.
  • How to work with persistence layers like NHibernate.

About the reader

The book assumes basic knowledge of ASP.NET (v. 3.5) and expands your expertise. The book's many examples are in C#.

About the authors

Jeffrey Palermo is co-creator of MvcContrib. Jimmy Bogard and Ben Scheirman are consultants and .NET community leaders. All are Microsoft MVPs and members of ASPInsiders.

This book put me in control of ASP.NET MVC.

Mark Monster, Rubicon

Of all the offerings, this one got it right!

Andrew Siemer, OTX Research

Highly recommended for those switching from Web Forms to MVC.

Frank Wang, DigitalVelocity LLC