Apress Access

Pro ASP.NET MVC 2 Framework

2nd Edition

By Steven Sanderson

  • eBook Price: $38.99
Buy eBook Buy Print Book
In this book, you'll discover MVC's strengths and weaknesses for yourself—and put your best-learned theory into practice.

Full Description

  • Add to Wishlist
  • ISBN13: 978-1-4302-2886-8
  • User Level: Intermediate to Advanced
  • Publication Date: June 29, 2010
  • Available eBook Formats: EPUB, MOBI, PDF

Related Titles

  • Windows 10 for the Internet of Things
  • DevOps on the Microsoft Stack
  • Building APIs with Node.js
  • Pro MEAN Stack Development
  • ASP.NET MVC with Entity Framework and CSS
Full Description

Author Steven Sanderson has seen the ASP.NET MVC Framework mature from the start, so his experience, combined with comprehensive coverage of all the new features, including those in the official MVC development toolkit, offers the clearest understanding of how this exciting new framework can improve your coding efficiency. With this book, you’ll gain invaluable up-to-date knowledge of security, deployment, and interoperability challenges.

The ASP.NET MVC 2 Framework introduces a radical high-productivity programming model that promotes cleaner code architecture, test-driven development, and powerful extensibility, combined with all the benefits of ASP.NET 3.5.

In this book, the core model-view-controller (MVC) architectural concepts are not simply explained or discussed in isolation, but are demonstrated in action. You’ll work through an extended tutorial to create a working e-commerce web application that combines ASP.NET MVC with C# language features and unit-testing best practices. By gaining this invaluable, practical experience, you’ll discover MVC’s strengths and weaknesses for yourself—and put your best-learned theory into practice.

What you’ll learn

  • Gain a solid architectural background to ASP.NET MVC 2, including MVC and REST concepts.
  • Explore the entire ASP.NET MVC Framework and take a detailed look at the official MVC development toolkit.
  • See how it works with test-driven development in action.
  • Capitalize on your existing knowledge quickly and easily through translation and comparison of features in classic ASP.NET to those in ASP.NET MVC.
  • Learn about the latest security and deployment issues, including IIS 7.0.

Who this book is for

This book is for web developers with a basic knowledge of ASP.NET and C# who want (or need) to start using the ASP.NET MVC 2 Framework.

Table of Contents

Table of Contents

  1. What’s the Big Idea?
  2. Your First ASP.NET MVC Application
  3. Prerequisites
  4. SportsStore: A Real Application
  5. SportsStore: Navigation and Shopping Cart
  6. SportsStore: Administration and Final Enhancements
  7. Overview of ASP.NET MVC Projects
  8. URLs and Routing
  9. Controllers and Actions
  10. Controller Extensibility
  12. Models and Data Entry
  13. User Interface Techniques
  14. Ajax and Client Scripting
  15. Security and Vulnerability
  16. Deployment
  17. ASP.NET Platform Features
  18. Upgrading and Combining ASP.NET Technologies
Source Code/Downloads

Downloads are available to accompany this book.

Your operating system can likely extract zipped downloads automatically, but you may require software such as WinZip for PC, or StuffIt on a Mac.


If you think that you've found an error in this book, please let us know by emailing to editorial@apress.com . You will find any confirmed erratum below, so you can check if your concern has already been addressed.

On page 32:
return View("Thanks", guestResponse);

should be

return View("Thanks", GuestResponse);

On page 111:
third bullet point

"You can trivially hook it up to any other IProductsController (e.g. for a different database or ORM technology)..."

I believe that "IProductsController" should be "IProductsRepository"

On page 122:
result.Append(tag.ToString()) instead of result.AppendLine(tag.ToString()) to pass unit test.

On page 124:

System.Web.Mvc.ActionResult does not contain a definition for 'VIewData' and no extension method 'ViewData' accepting a first argument of type 'System.Web.Mvc.ActionResult' could be found

//This line caused the error
var ViewModel = (ProductsListViewModel) result.ViewData.Model;

//Please not I am runing Visual Studio 2010

On page 143:
Unit test won't compile b/c of the CollectionAssert line. The second parameter is looking for an ICollection and cannot convert an IEnumerable to an ICollection.

On page 220:

The third bullet states that the framework will look for Views/Product/SomeView.aspx. This should be Views/Products/SomeView.aspx

On page 466:

Html.ValidateFor( should be Html.ValidateMessageFor(


    1. Expert ASP.NET Web API 2 for MVC Developers


      View Book

    2. Pro ASP.NET MVC 5 Platform


      View Book

    3. ASP.NET Web API 2 Recipes


      View Book

    4. ASP.NET Web API 2: Building a REST Service from Start to Finish


      View Book