ASP.NET MVC in Action
With MvcContrib, NHibernate, and more
Jeffrey Palermo, Ben Scheirman, and Jimmy Bogard
  • September 2009
  • ISBN 9781933988627
  • 392 pages
  • printed in black & white
This title is out of print and no longer for sale.

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

Phil Haack, Microsoft

Third edition of this book is 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 show full

foreword

preface

acknowledgments

about this book

about the authors

about the cover illustration

Getting started with the ASP.NET MVC Framework

Picking apart the default application

Your first ASP.NET MVC controller from scratch

Our first view

Ensuring the application is maintainable

Testing controller classes

Summary

The model in depth

Understanding the basics of domain-driven design

Domain model for this book

Presentation model

Working with the model

Summary

The controller in depth

The controller action

Simple controllers do not need a view

Testing controllers

Simple actions and views

Working with form values

Processing querystring parameters

Binding more complex objects in action parameters

Options for passing ViewData

Filters

Summary

The view in depth

How ASP.NET MVC views differ from Web Forms

Folder structure and view basics

Overview of view basics

Leveraging the view to create dynamic screens

Summary

Routing

What are routes?

Designing a URL schema

Implementing routes in ASP.NET MVC

Using the routing system to generate URLs

Creating routes for Code Camp Server

Testing route behavior

Using routing with existing ASP.NET projects

Summary

Customizing and extending the ASP.NET MVC Framework

Extending URL routing

Creating your own ControllerFactory

Extending the controller

Creating a custom view engine

Customizing Visual Studio for ASP.NET MVC

Summary

Scaling the architecture for complex sites

Taming large controller actions

Whipping views into shape

Using action filters to load common data

Organizing controllers into areas

Summary

Leveraging existing ASP.NET features

ASP.NET server controls

State management

Tracing and debugging

Implementing personalization and localization

Implementing ASP.NET site maps

Summary

AJAX in ASP.NET MVC

Diving into AJAX with an example

AJAX with ASP.NET Web Forms

AJAX in ASP.NET MVC

Summary

Hosting and deployment

Deployment scenarios

XCOPY deployment

Deploying to IIS 7

Deploying to IIS 6 and earlier

Automating deployments

Summary

Exploring MonoRail and Ruby on Rails

MonoRail

Ruby on Rails

Summary

Best practices

Controllers

Views

Routes

Testing

Summary

Recipes

jQuery autocomplete text box

Automatic client-side validation

Data access with NHibernate

Designing views with the Spark view engine

Summary

index

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.