The design goal for this book is to give you, the reader, the most practical and detailed guide to virtually everything that ASP.NET MVC does. If you want to become your company’s expert on how this stuff really works – how to bend it to your will, how to apply best practises, and what limitations you’ll have to overcome – then I hope this is the book for you.
Part 1: Introducing ASP.NET MVC
CHAPTER 1 : What’s the Big Idea?
A Brief History of Web Development
Traditional ASP.NET
What’s Wrong with Traditional ASP.NET?
Web Development Today
Web Standards and REST.
Agile and Test-Driven Development
Ruby on Rails
Key Benefits of ASP.NET MVC
Model-View-Controller Architecture
Extensibility
Testability
Tight Control over HTML
Powerful New Routing System
Built on the Best Parts of the ASP.NET Platform
.NET 3.5 Language Innovations
ASP.NET MVC Is Open Source
Who Should Use ASP.NET MVC?
Comparisons with ASP.NET WebForms
Comparisons with Ruby on Rails
Comparisons with MonoRail
CHAPTER 2 : Your First ASP.NET MVC Application
Preparing Your Workstation
Creating a New ASP.NET MVC Project
Removing Unnecessary Files
How Does It Work?
Rendering Web Pages
Creating and Rendering a View
Adding Dynamic Output
A Starter Application
The Story
Linking Between Actions
Designing a Data Model
Building a Form
Handling Form Submissions
Adding Validation
Finishing Off
CHAPTER 3 : Prerequisites
Understanding Model-View-Controller Architecture
The Smart UI (Anti-Pattern)
Separating Out the Domain Model
Three-Tier Architecture
Model-View-Controller Architecture
Variations on Model-View-Controller
Domain Modeling
An Example Domain Model
Entities and Value Objects
Ubiquitous Language
Aggregates and Simplification
Keeping Data Access Code in Repositories
Using LINQ to SQL
Building Loosely Coupled Components
Taking a Balanced Approach
Using Inversion of Control
Using an IoC Container
Getting Started with Automated Testing
Unit Tests and Integration Tests
The Red-Green Development Style
New C# 3 Language Features
The Design Goal: Language Integrated Query
ExtensionMethods
Lambda Methods
GenericType Inference
Automatic Properties
Objectand Collection Initializers
Type Inference
Anonymous Types
Using LINQ to Objects
Lambda Expressions
IQueryable<T> and LINQ to SQL
CHAPTER 4 : SportsStore: A RealApplication
Getting Started
Creating Your Solutions and Projects
Starting Your Domain Model
Creating an Abstract Repository
Making a Fake Repository
Displaying a List of Products
Removing Unnecessary Files
Adding the First Controller
Setting Up the Default Route
Adding the First View
Connecting to a Database
Defining the Database Schema
Setting Up LINQ to SQL
Creating a Real Repository
Setting Up Inversion of Control
Creating a Custom Controller Factory
Using Your IoC Container
Creating Automated Tests
Configuring a Custom URL Schema
Adding a RouteTable Entry
Displaying Page Links
Styling It Up
Defining Page Layout in the Master Page
Adding CSS Rules
Creating a Partial View
CHAPTER 5 : SportsStore: Navigation andShopping Cart
Adding Navigation Controls
Filtering the Product List
Defining a URL Schema for Categories
Building a Category Navigation Menu
Building the Shopping Cart
Defining the Cart Entity
Adding “Add to Cart” Buttons
Giving Each Visitor a Separate Shopping Cart
Creating CartController
Displaying the Cart
Removing Items from the Cart
Displaying a Cart Summary in the Title Bar
Submitting Orders
Enhancing the Domain Model
Adding the “Check Out Now” Button
Prompting the Customer for Shipping Details
Defining an Order Submitter IoC Component
Completing CartController
Implementing the EmailOrderSubmitter
CHAPTER 6 : SportsStore: Administrationand Final Enhancements
Adding Catalog Management
Creating AdminController: A Place for the CRUD Features
Rendering a Grid of Products in the Repository
Building a Product Editor
Creating New Products
Deleting Products
Securing the Administration Features
Setting Up Forms Authentication
Using a Filter to Enforce Authentication
Displaying a Login Prompt
Image Uploads
Preparing the Domain Model and Database
Accepting File Uploads
Displaying Product Images
Part 2: ASP.NET MVC in Detail
CHAPTER 7 : Overview of ASP.NET MVC Projects
Developing MVC Applications in Visual Studio
The Default MVC Project Structure
Naming Conventions
The Initial Application Skeleton
Debugging MVC Applications and Unit Tests
Using the Debugger
Stepping into the .NET Framework Source Code
Stepping into the ASP.NET MVC Source Code
The Request Processing Pipeline
Stage 1: IIS
Stage 2: Core Routing
Stage 3: Controllers and Actions
Stage 4: Action Results and Views
CHAPTER 8 : URLs and Routing
Putting the Programmer Back in Control
Setting Up Routes
Understanding the Routing Mechanism
Adding a Route Entry
Using Parameters
Using Defaults
Using Constraints
Accepting a Variable-Length List of Parameters
Matching Files on the Server’s Hard Disk
Using IgnoreRoute to Bypass the Routing System
Generating Outgoing URLs
Generating Hyperlinks with Html.ActionLink
Generating Links and URLs from Pure Routing Data
Performing Redirections to Generated URLs
Understanding the Outbound URL-Matching Algorithm
Generating Hyperlinks with Html.ActionLink<T> and Lambda Expressions
Working with Named Routes
Unit Testing Your Routes
Testing Inbound URL Routing
Testing Outbound URL Generation
Further Customization
Implementing a Custom RouteBase Entry
Implementing a Custom Route Handler
URL Schema Best Practices
Make Your URLs Clean and Human-Friendly
Follow HTTP Conventions
Search Engine Optimization
CHAPTER 9 : Controllers and Actions
An Overview
Comparisons with ASP.NET WebForms
All Controllers Implement IController
The Controller Base Class
Receiving Input
Getting Data from Context Objects
Using Action Method Parameters
Invoking Model Binding Manually in an Action Method
ProducingOutput
Understanding the ActionResult Concept
Returning HTML by Rendering a View
Performing Redirections
Returning Textual Data
Returning JSON Data
Returning JavaScript Commands
Returning Files and Binary Data
Creating a Custom Action Result Type
Using Filters to Attach Reusable Behaviors
Introducing the Four Basic Types of Filters
Applying Filters to Controllers and Action Methods
Creating Action Filters and Result Filters
Creating and Using Authorization Filters
Creating and Using Exception Filters
Bubbling Exceptions Through Action and Result Filters
The [OutputCache] Action Filter
Other Built-In Filter Types
Controllers As Part of the Request Processing Pipeline
Working with DefaultControllerFactory
Creating a Custom Controller Factory
Customizing How Action Methods Are Selected and Invoked
Testing Controllers and Actions
How to Arrange, Act, and Assert
Testing a Choice of View and ViewData
Testing Redirections
More Comments About Testing
Mocking Context Objects
CHAPTER 10 : Views
How Views Fit into ASP.NET MVC
The WebForms View Engine
View Engines Are Replaceable
WebForms View Engine Basics
Adding Content to a View Template
Five Ways to Add Dynamic Content to a View Template
Using Inline Code
Why Inline Code Is a Good Thing in MVC View Templates
Understanding How MVC Views Actually Work
Understanding How ASPX Templates Are Compiled
Understanding ViewData
Rendering ViewData Items Using ViewData.Eval
Using HTML Helper Methods
The Framework’s Built-In Helper Methods
Creating Your Own HTML Helper Methods
Using Partial Views
Creating a Partial View
Rendering a Partial View Using Server Tags
Using Html.RenderAction to Create Reusable Widgets with
Application Logic
What Html.RenderAction Does
When It’s Appropriate to Use Html.RenderAction
Creating a Widget Based on Html.RenderAction
Sharing Page Layouts Using Master Pages
Using Widgets in MVC View Master Pages
Implementing a Custom View Engine
A View Engine That Renders XML Using XSLT
Using Alternative View Engines
Using the NVelocity View Engine
Using the Brail View Engine
Using the Spark View Engine
Using the NHaml View Engine
CHAPTER 11 : Data Entry
Model Binding
Model-Binding to Action Method Parameters
Model-Binding to Custom Types
Invoking Model Binding Directly
Model-Binding to Arrays, Collections, and Dictionaries
Creating a Custom Model Binder
Using Model Binding to Receive File Uploads
Validation
Registering Errors in ModelState
View Helpers for Displaying Error Information
How the Framework Maintains State in Input Controls
Performing Validation During Model Binding
Moving Validation Logic into Your Model Layer
About Client-Side (JavaScript) Validation
Wizards and Multistep Forms
Verification
Implementing a CAPTCHA
Confirmation Links and Tamper-Proofing with HMAC Codes
CHAPTER 12 : Ajax and Client Scripting
Why You Should Use a JavaScript Toolkit
ASP.NET MVC’s Ajax Helpers
Fetching Page Content Asynchronously Using Ajax.ActionLink
Submitting Forms Asynchronously Using Ajax.BeginForm
Invoking JavaScript Commands from an Action Method
Reviewing ASP.NET MVC’s Ajax Helpers
Using jQuery with ASP.NET MVC
Referencing jQuery
Basic jQuery Theory
Adding Client-Side Interactivity to an MVC View
Ajax-Enabling Links and Forms
Client/Server Data Transfer with JSON
Fetching XML Data Using jQuery
Animations and Other Graphical Effects
jQuery UI’s Prebuilt User Interface Widgets
Implementing Client-Side Validation with jQuery
Summarizing jQuery
CHAPTER 13 : Security and Vulnerability
All Input Can Be Forged
Forging HTTP Requests
Cross-Site Scripting and HTML Injection
Example XSS Vulnerability
ASP.NET’s Request Validation Feature
Filtering HTML Using the HTML Agility Pack
Session Hijacking
Defense via Client IP Address Checks
Defense by Setting the HttpOnly Flag on Cookies
Cross-Site Request Forgery
Attack
Defense
Preventing CSRF Using the Anti-Forgery Helpers
SQL Injection
Attack
Defense by Encoding Inputs
Defense Using Parameterized Queries
Defense Using Object-Relational Mapping
Using the MVC Framework Securely
Don’t Expose Action Methods Accidentally
Don’t Allow Model Binding to Change Sensitive Properties
CHAPTER 14 : Deployment
Server Requirements
Requirements for Shared Hosting
IIS Basics
Understanding Web Sites and Virtual Directories
Binding Web Sites to Hostnames, IP Addresses, and Ports
How IIS Handles Requests and Invokes ASP.NET
Deploying Your Application
Copying Your Application Files to the Server
Using Visual Studio ’s Publish Feature
Making It Work on Windows Server /IIS 6
Making It Work on IIS 7
Making Your Application Behave Well in Production
Supporting Changeable Routing Configurations
Supporting Virtual Directories
Using ASP.NET’s Configuration Facilities
Controlling Compilation on the Server
Detecting Compiler Errors in Views Before Deployment
CHAPTER 15 : ASP.NET Platform Features
Windows Authentication
Preventing or Limiting Anonymous Access
Forms Authentication
Setting Up Forms Authentication
Using Cookieless Forms Authentication
Membership, Roles, and Profiles
Setting Up a Membership Provider
Using a Membership Provider with Forms Authentication
Creating a Custom Membership Provider
Setting Up and Using Roles
Setting Up and Using Profiles
URL-Based Authorization
Data Caching
Reading and Writing Cache Data
Using Advanced Cache Features
Site Maps
Setting Up and Using Site Maps
Creating a Custom Navigation Control with the Site Maps API
Generating Site Map URLs from Routing Data
Internationalization
Setting Up Internationalization
Tips for Working with Resource Files
Using Placeholders in Resource Strings
Performance
HTTP Compression
Tracing and Monitoring
Monitoring Page Generation Times
Monitoring LINQ to SQL Database Queries
CHAPTER 16 : Combining MVC and WebForms
Using WebForms Technologies in an MVC Application
Using WebForms Controls in MVC Views
Using WebForms Pages in an MVC Web Application
Adding Routing Support for WebForms Pages
Using ASP.NET MVC in a WebForms Application
Upgrading an ASP.NET WebForms Application to Support MVC
Getting Visual Studio to Offer MVC Items
Interactions Between WebForms Pages and MVC Controllers
April 29th, 2009 at 10:54 am
Congratulations Steve, will be acquiring a copy soon. I don’t see a direct link for it!
April 29th, 2009 at 10:58 am
Congratulations. Does the book cover C# and/or VB? Is there a sample chapter available online?
April 29th, 2009 at 11:10 am
Well done Steve, I have my order with Amazon already
April 29th, 2009 at 11:19 am
Good show. Looks to be pretty comprehensive. Well done for getting it over the line, can’t have been easy.
April 29th, 2009 at 11:24 am
Thanks everyone!
@Andrew - all the code is in C#, since that’s what virtually all ASP.NET MVC developers seem to be using. There is a sample chapter online - I’ve just added a link to the beginning of this blog post.
April 29th, 2009 at 11:28 am
Congratulations Steve! Nice job!
April 29th, 2009 at 11:35 am
Nice one. Just going to order my copy now :D.
April 29th, 2009 at 1:27 pm
Looking forward to reading yours. I’ve enjoyed your MVC blog posts and I have high hopes for the book.
We’re wrapping up on ours as well, it will be exciting to see it on store shelves!
April 29th, 2009 at 1:46 pm
Congratulations!
April 29th, 2009 at 2:36 pm
Awesome. Just ordered a copy from Amazon. This is the third MVC book I’ve bought and I have a feeling that this may be the book I get the most out of. Congrats on finally getting it published.
April 29th, 2009 at 2:44 pm
First off - wow!
Second, congrats to you!
From the table of contents, I see I’m definitely going to need to grab this book!
April 29th, 2009 at 2:49 pm
[…] Sanderson’s book ‘Pro ASP.NET MVC Framework (Apress)‘ has been […]
April 29th, 2009 at 2:53 pm
Great, picking up a copy from Amazon largely because the writing of this blog is so good. Keep up the good work!
April 29th, 2009 at 4:50 pm
I purchased the ebook PDF directly from Apress (cheaper, instant delivery, fewer dead trees, etc) and I am really enjoying it so far. I’m only on chapter 4 so far, but I’m already excited about the content it has covered and what future content is in the upcoming chapters. This book appears to have everything you need to build a complete ASP.NET MVC web application. I’d consider myself an intermediate developer, but the book seems accessible to both beginning and advanced developers who have some ASP.NET experience or other web framework experience (PHP, Rails, JSP, etc). Thanks for the hard work. How much of your ASP.NET MVC blog content made it into the book? If anything didn’t make it (I don’t see anything about ‘app areas’ [1]), maybe you could create a future blog post with links to all the ‘extra’ content?
Thanks!
[1] http://blog.codeville.net/2008/11/05/app-areas-in-aspnet-mvc-take-2/
April 30th, 2009 at 6:48 am
[…] Now Published: Pro ASP.NET MVC Framework (Apress) - Steve Sanderson announces the release of his book ‘Pro ASP.NET MVC Framework’ covering the RTM release of the ASP.NET MVC framework […]
April 30th, 2009 at 9:25 am
It’s available in the UK at SprintBooks https://www.sprintbooks.co.uk/scripts/browse.asp?ref=878981 Cheaper than Amazon.co.uk (Amazon don’t have it in stock as I write this).
April 30th, 2009 at 9:27 am
Congratulations Steve on your book!!
April 30th, 2009 at 11:08 am
I ordered mine here for £26 and free delivery. Its in stock too! http://books.theregister.co.uk/catalog/browse.asp?advert=Froogle&ref=878981
April 30th, 2009 at 11:33 pm
My copy arrived today (which is how I found this blog - from the intro) and looking forward to working through it.
However what’s with the dark grey text on slightly greener grey text that this site uses for most of the blog entries (the chapter contents above are virtually unreadable on my monitor)? It makes the blog almost impossible to read?!
May 1st, 2009 at 4:01 am
My book arrived today and working my way through it. Absolutely spectacular. Exactly what I needed to move past demoware and get on with building something non-trivial. Your hard work is my gain. Many, many thanks!
May 1st, 2009 at 4:38 am
Absolutely great book so far. Really like the layout/format and your explanations are very good. Learning a lot. Highly recommend this to anyone on the fence as far as spending the extra money.
May 1st, 2009 at 7:13 am
More thanks to everyone for your kind comments! By the way, you can also post your feedback as comments at http://www.amazon.com/gp/product/1430210079
@Ian - the theme I’m using for my blog has a slightly weird CSS quirk whereby the page starts out with a dark gray background while loading and then goes white when it’s finished loading. If the page never finishes loading for some reason then it would presumably stay dark gray, though I’ve never seen it happen myself. I’ll hopefully switch to a different theme soon when I move this blog to a different web host.
May 1st, 2009 at 2:58 pm
I guess it’s also available for preview on Google Books? [1] I’m not sure what the limitations are (you can only read N number of pages?) but I was able to scroll and search through the entire book.
I found it by accident, because I was searching google for some sort of information on how the DefaultControllerFactory seemingly is able to ignore requests for style sheets and images (with an explicit IgnoreRoute), but the custom WindsorControllerFactory implementation fails (controllerType = null)?
Reflectoring DefaultControllerFactory didn’t seem to help. Oh well… the problem was that I didn’t remove the style.css reference from the master page in the Chapter 4 example.
[1] http://books.google.com/books?id=Xb3a1xTSfZgC
[2] http://stackoverflow.com/questions/719678/custom-controller-factory-dependency-injection-structuremap-problems-with-asp
May 1st, 2009 at 6:02 pm
Thanks for the response. Now that I’ve browsed using firefox and Chrome everything is fine. This looks like an Internet Explorer 8 problem. No matter how many times I refresh the page it stays “stuck” on dark grey background.
May 1st, 2009 at 9:43 pm
I just got my copy in the mail yesterday, Im going to devour this like a fat girl in an ice cream shop
May 2nd, 2009 at 1:40 am
Steve,
Just got a copy of your book. Lots of great stuff.
I was not able to locate the source on the Apress website. I’m under a deadline for an MVC prototype.
Can you email me the source asap or provide a direct link ?
Thanks in advance
May 2nd, 2009 at 10:23 pm
Arrived in the post today. I planned not to think about computer programming this (long) weekend… but soon found myself immersed in the MVC goodness! Exciting times for .NET web developers…
May 2nd, 2009 at 10:27 pm
@Ian: I set up my first MVC project in VS today and hit F5. IE 8 fired up, sat there and then BLUESCREENED! This is the first time that my Vista PC has blued. (Normally I use a PC at work with IE 7 for development.) Apparently I’m not the only one to get this. I don’t think IE 8 is a happy release.
May 3rd, 2009 at 1:43 pm
Got the book yesterday and really think that it is an excellent guide to getting up and running. Also tried to find the source code on the Apress site but seems to be missing.
May 3rd, 2009 at 4:21 pm
The downloadable source code has just been submitted to Apress today, so it should be on their website within a day or two.
If it looks like it’s going to take longer, I’ll host it somewhere myself and provide a download link
May 6th, 2009 at 2:12 am
Steve,
Thanks for the heads up about the source code.
May 6th, 2009 at 6:39 pm
Congratulations Steven! Just got the print and pdf (laptop) versions. First scan of content gives me the feeling this one is a ‘gotta have’ for MVC 1.0 … Best of luck and thanks for the efforts all the way back to Dec 07.
May 6th, 2009 at 7:43 pm
For anyone waiting for the book’s source code, here’s a temporary download link: http://blog.codeville.net/blogfiles/2009/May/ProASPNETMVC-SourceCode.zip
Note that I’ll remove this temporary file when the source code becomes available on Apress.com.
May 7th, 2009 at 2:45 pm
Wow! Just wow, Steve! Hands down my favorite ASP.NET MVC book available and I am just half way done with it. Taking the day off just to finish it.
Packed with unbelievable practical knowledge on the internals of ASP.NET MVC as well as how to develop an ASP.NET MVC web application.
Well done!
May 12th, 2009 at 7:07 am
Excellent book - really well written.
Good stuff!
Rich
May 14th, 2009 at 10:31 pm
Many thanks Steve, your book is just brilliant.
Matches the elegance of the framework, well done.
May 18th, 2009 at 7:16 am
Hi,
Been working through your book and really enjoying it. A couple of things 1) Apress have not made the sample code available (Very frustrating) 2) I have been playing with the sitemap and navigation and keep getting an error that the base provider needs a unique url per node … any guidance would be great.
Andrew
May 20th, 2009 at 7:33 am
Andrew, please download the source code from http://blog.codeville.net/blogfiles/2009/May/ProASPNETMVC-SourceCode.zip (sorry it’s not on the Apress site yet!).
The core ASP.NET sitemap feature does have the limitation that each node needs a unique URL.
May 21st, 2009 at 4:13 am
Great book Steve! I bought and downloaded the eBook tonight, and after 100 pages in I’m loving it! Great work!
May 24th, 2009 at 1:33 pm
Steve, I don’t need to ask you how the book is going anymore. You’ve finished it now, and a very well researched book it is too!
With a background fairly and squarely in the world of Java, a book about Microsoft’s MVC framework would never normally be on my reading list. However, having just read some of the early chapters this morning, your enthusiasm for the framework and clear ability to communicate its detail is impressive.
So, when I’ve completed Rademakers book on ESBs, maybe it’s time to get back into the world of Microsoft web apps; if so, then I can’t think of a better place to start than reading your book.
Once again, excellent work!
May 25th, 2009 at 2:03 pm
Waiting for the book to be shipped from Amazon.ca. Don’t buy from the .ca - it takes WEEKS just to get shipped.
Should have ordered from amazon.com.
Oh well, looking forward to reading it.
May 27th, 2009 at 1:01 pm
I am still at page 110 and this is my feedback so far:
1 - Nice style.
2 - Simple and direct.
3 - Written by an expert.
My question is that why using Windsor Castle rather than Unity given that Unity is a Microsoft solution and it is nice to have a complete end to end Microsoft based solution.
I feel that the term IoC is a bit outdated now and replaced with the more accurate term “Dependency Injection” as Martin Fowler recommeded.
May 27th, 2009 at 2:26 pm
ITSoulsenz.com - Software Development has become very popular with more and more companies including, software development services,software development technologies, software outsourcing,their international business prospects.
June 5th, 2009 at 7:28 pm
I am learning MVC thanks
June 14th, 2009 at 7:45 pm
On page 128 if you wish to get rid of the FakeResponse class you can do this, providing your version of Moq supports this functionality:
var fakeResponse = new Mock();
fakeResponse.Setup(e => e.ApplyAppPathModifier(It.IsAny())).Returns((string virtualPath) => virtualPath);
This gets rid of the need to have the Test Double class FakeResponse. Great book though I am really enjoying reading it.
June 16th, 2009 at 7:56 am
@Richard - thanks for the suggestion. Actually I did write it like this at one point, but felt that it was harder for readers to understand. Maybe I was wrong though
June 16th, 2009 at 11:47 pm
Steven;
I’ve not yet added my 5-star review at Amazon as I’ve not finished the book, (I did enter one for the Preview), but I wanted to let you know now how great it was to find an example of Model-Binding to a Dictionary, page 378; just what I needed. As I think one Amazon reviewer said, you set a new standard for tech books. Very nice work. (Maybe you can get Apress and Wrox into a bidding war.:))
Thanks,
Bill
(This reply originally entered on the Integration Testing You MVC App blog. Oops. I copied it here, where it belongs. Bill)
June 17th, 2009 at 12:06 pm
Hi Steve,
I am having problems downloading the Castle project. The link for the download seem to be dead. Is there somewhere else where I can get the download? I am trying to follow along in your book, a great read and great explanations so far. Thanks.
Hoang
June 21st, 2009 at 4:31 pm
Hoang: I had some trouble with that download too. I assume you want to download the installer package. Try this:
http://sourceforge.net/project/downloading.php?groupname=castleproject&filename=CastleProject-1.0-RC3.msi&use_mirror=superb-west
and click on the big link “Download Castle Project” next to the big green arrow poining down. The download file will be this: CastleProject-1.0-RC3.msi.
Bill
July 17th, 2009 at 5:35 pm
Love the book. A must have.
Best,
Patrick
August 6th, 2009 at 3:39 pm
Do you know if I can use the ASP.NET MVC 2 Preview 1 with the book? I just got the book today but I haven’t opened it yet. Really looking forward to it, Craig
August 10th, 2009 at 2:46 pm
The book is very well written, but there appears to be some differences in Visual Studio from the book to the current (SP1 with latest updates). For instance, when you create a Blank Solution and add the “Domain Model” C# class library, you can only see the Domain Model and can’t seem to add additional projects to the SportsStore solution (the WebUI and Tests). Am I missing something? How do I add the additional projects to the Solution?
August 10th, 2009 at 3:04 pm
Found it. I think this is counter-intuitive on Microsoft’s part. The answer is, even though the only thing that appears in the Solution Explorer is the “DomainModel” project, I tried File | New | Project, chose “ASP.NET MVC Web Application”, the next screen allowed me to “Add to Solution”. Once that took place, the solution explorer showed both projects and the solution itself. I could then right-click the solution and add a “Tests” project to the solution. Funny how something that simple can hang things up. Thanks again to Steven for a great and readable book.
August 31st, 2009 at 3:10 pm
Excellent book! MVC leads to some very elegant code. I did just find a wonderful feature in SQL 2008 for dealing with large files. The book uses a vanilla VARBINARY without filestream support, but it is fairly trivial to get filestream going. Works great with larger files like PDFs and office documents!
August 31st, 2009 at 4:23 pm
@Craig - this book is written for ASP.NET MVC 1.0 RTM version. Almost all of it will still apply to MVC v2, but of course there will be some new parts in MVC v2 not covered in the book. Since MVC v2 is still early in development and constantly changing, I can’t promise which of the code samples will or won’t work without modification.
September 4th, 2009 at 9:29 am
Hi Steve,
Great book! Really readable.
Is there sample code for the validation sample you describe in chapter 11? The download from apress doesn’t seem to include anything. Thanks for your help.
September 4th, 2009 at 12:44 pm
I’m halfway through your book and am really enjoying it, not only am I learning MVC but also Testing, Mocking, and IoC. I have ended up using StructureMap in my SportsStore, just because I was inspired to explore the topic and find one I liked. I would advise readers to keep an eye on the new MVC 2 features since they are easy to integrate into the examples.
This is the first time I have typed all the code from a book since I was a teenager with a C64!
September 28th, 2009 at 8:43 am
Now Published: Pro ASP.NET MVC Framework (Apress) « Steve Sanderson’s blog…
Thank you for submitting this cool story - Trackback from Servefault.com…
November 3rd, 2009 at 4:58 am
i already Buy this book i loved this book are you give me info about your some other book & blog
November 9th, 2009 at 4:07 pm
Great book!
One question. Could I use source code from book on my production website?
Thanks in advance for answer.
February 14th, 2010 at 4:20 pm
The best ASP.NET MVC Book on the market !
Thanks from France
February 17th, 2010 at 7:49 am
Hi Steve. This book is the best! Are you planning to write a book for MVC 2?