ASP.NET MVC 4 in Action
Revised edition of ASP.NET MVC 2 in Action
Jeffrey Palermo, Jimmy Bogard, Eric Hexter, Matthew Hinze, and Jeremy Skinner
Foreword by Phil Haack
  • May 2012
  • ISBN 9781617290411
  • 440 pages
  • printed in black & white

Guides you through the inner workings of ASP.NET MVC.

Phil Haack, GitHub

ASP.NET MVC 4 in Action is a fast-paced tutorial designed to introduce ASP.NET MVC to .NET developers and show how to apply it effectively. All examples in this revised edition are based on ASP.NET MVC 4, so you'll get full coverage of features such as the Razor view engine, Web Matrix helpers, and improved extensibility. You'll see how your ASP.NET applications can benefit from changes in the .NET Framework.

Table of Contents show full


foreword to the second edition

foreword to the first edition



about this book

about the authors

about the cover illustration

Part 1 High-speed fundamentals

1. Introduction to ASP.NET MVC

1.1. Setting the stage

1.2. What is ASP.NET MVC?

1.3. What’s new in ASP.NET MVC 3/4?

1.4. Summary

2. Hello MVC world

2.1. Setting up your development environment

2.2. Creating your first MVC application

2.3. The Guestbook sample application

2.4. Summary

3. View fundamentals

3.1. Introducing views

3.2. Passing data to views

3.3. Using strongly typed templates

3.4. Summary

4. Action-packed controllers

4.1. Exploring controllers and actions

4.2. What should be in an action method?

4.3. Introduction to unit testing

4.4. Summary

Part 2 Working with ASP.NET MVC

5. View models

5.1. What is a view model?

5.2. Representing user input

5.3. More complex models for both display and input

5.4. Summary

6. Validation

6.1. Server-side validation

6.2. Client-side validation

6.3. Summary

7. Ajax in ASP.NET MVC

7.1. Ajax with jQuery

7.2. ASP.NET MVC Ajax helpers

7.3. Ajax with JSON and client templates

7.4. Creating an autocomplete text box

7.5. Summary

8. Security

8.1. Authentication and authorization

8.2. Cross-site scripting (XSS)

8.3. Cross-site request forgery (XSRF)

8.4. Summary

9. Controlling URLs with routing

9.1. Introducing URL routing

9.2. Designing a URL schema

9.3. Implementing routes in ASP.NET MVC

9.4. Using the routing system to generate URLs

9.5. Routing with ASP.NET Web Forms

9.6. Debugging routes

9.7. Testing route behavior

9.8. Summary

10. Model binders and value providers

10.1. Creating a custom model binder

10.2. Using custom value providers

10.3. Summary

11. Mapping with AutoMapper

11.1. Life before AutoMapper

11.2. Introducing AutoMapper

11.3. AutoMapper basics

11.4. Summary

12. Lightweight controllers

12.1. Why lightweight controllers?

12.2. Techniques for simplifying controllers

12.3. Summary

13. Organization with areas

13.1. Creating a basic area

13.3. Summary

14. Third-party components

14.1. Learning about NuGet

14.2. Using ASP.NET Web Helpers

14.3. The MvcContrib Grid component

14.4. Summary

15. Data access with NHibernate

15.1. Functional overview of reference implementation

15.2. Application architecture overview

15.3. Exploring the Core

15.4. NHibernate configuration–infrastructure of the application

15.5. Presenting the model through the UI

15.6. Pulling it together

15.7. Summary

Part 3 Mastering ASP.NET MVC

16. Extending the controller

16.1. Controller extensibility

16.2. Controller actions

16.3. Action, authorization, and result filters

16.4. Action selectors

16.5. Using action results to reduce complexity

16.6. Summary

17. Advanced view techniques

17.1. Eliminating duplication in the view

17.2. Building query-string parameter lists

17.3. Exploring the Spark view engine

17.4. Summary

18. Dependency injection and extensibility

18.1. Introducing dependency injection

18.2. Using DI with ASP.NET MVC

18.3. Summary

19. Portable areas

19.1. NuGet packaging basics

19.2. Creating an RSS widget with a portable area

19.3. Interacting with the portable area bus

19.4. Summary

20. Full system testing

20.1. Testing the UI layer

20.2. Building maintainable navigation

20.3. Interacting with forms

20.4. Asserting results

20.5. Summary

21. Hosting ASP.NET MVC applications

21.1. Hosting environments

21.2. XCOPY deployment

21.3. IIS 7

21.4. IIS 6 and 5.1

21.5. Azure hosting

21.6. Summary

22. Deployment techniques

22.1. Employing continuous integration

22.2. Enabling push-button XCOPY deployments

22.3. Managing environment configurations

22.4. Enabling remote server deployments with Web Deploy

22.5. Summary

23. Upgrading to ASP.NET MVC 4

23.1. Runtime view selection with DisplayModes

23.2. Combining and minifying client assets

23.3. Improvements to Razor

23.4. Summary


24.1. What is Web API?

24.2. Adding web services to the Guestbook application

24.3. Web API alternative

24.4. Summary


© 2014 Manning Publications Co.

About the Technology

ASP.NET MVC provides the architecture needed to separate an application's logic and its UI. Because each component's role is well defined, MVC applications are easy to test, maintain, and extend. The latest version, ASP.NET MVC 4, takes advantage of .NET 4 and includes powerful features like the Razor view engine, Web Matrix helpers, and enhanced extensibility.

About the book

ASP.NET MVC 4 in Action is a hands-on guide that shows you how to apply ASP.NET MVC effectively. After a high-speed ramp up, this thoroughly revised new edition explores each key topic with a self-contained example so you can jump right to the parts you need. Based on thousands of hours of real-world experience, the authors show you valuable high-end techniques you won't find anywhere else. Written for developers, the book arms you with the next-level skills and practical guidance to create compelling web applications. You need some knowledge of ASP.NET and C#, but no prior ASP.NET MVC experience is assumed.

What's inside

  • Complete coverage of ASP.NET MVC 4
  • The new Web API
  • Full-system testing

About the reader

You need some knowledge of ASP.NET and C#, but no prior ASP.NET MVC experience is assumed.

About the authors

Jeffrey Palermo, Jimmy Bogard, Eric Hexter, Matthew Hinze, and Jeremy Skinner are all ASP.NET MVPs, ASP insiders, and early adopters of ASP.NET MVC.

combo $49.99 pBook + eBook
eBook $39.99 pdf + ePub + kindle

FREE domestic shipping on three or more pBooks

A brilliant book for a great framework

Jonas Bandi, TechTalk

A complete guide, with established open source tools.

Apostolos Mavroudakis, UBS AG

A great addition to a great series of books.

Paul Stack,

Practical web application construction for the pragmatic practitioner.

Arun Noronha, Guardian Protection Services