Professional ASP.NET MVC 3 1st Edition
| Jon Galloway (Author) Find all the books, read about the author, and more. See search results for this author |
Use the Amazon App to scan ISBNs and compare prices.
MVC 3 is the latest update to Microsoft's Model-View-Controller technology, which enables developers to build dynamic, data-driven web sites. This in-depth book shows you step by step how to use MVC 3. Written by top ASP.NET MVC experts at Microsoft, the latest edition of this popular book covers new and updated features such as the new View engine, Razor, NuGet, and much more. The book's practical tutorials reinforce concepts and allow you create real-world applications. Topics include controllers and actions, forms and HTML helpers, Ajax, unit testing, and much more.
- Shows developers and programmers how to use ASP.NET MVC 3, Microsoft's new version of its Model-View-Controller technology for developing dynamic, data-driven web sites
- Features an expert author team?all are members of Microsoft's ASP.NET team
- Uses a step-by-step approach to explain all major features and functionalities and provides practical tutorials to allow you to create real-world applications
- Goes into theory as well as practical application and covers such topics as Razor, NuGet (PowerShell inside Visual Studio 2010), and new layout features
Editorial Reviews
From the Back Cover
ASP.NET MVC 3 is the eagerly anticipated revision of Microsoft's approach for creating data-driven dynamic applications. Written by a team of Microsoft insiders, this in-depth book shows you how to use the new features and exciting capabilities of ASP.NET MVC 3. Beginning with a short introduction to the ASP.NET MVC framework, this resource quickly shows you each step to install and create an ASP.NET MVC project. In addition, practical tutorials reinforce concepts and prepare you to create real-world applications.
Professional ASP.NET MVC 3:
-
Describes what views are and explores the Razor syntax, NuGet, unit testing, and much more
-
Explains the role of Controllers in the MVC framework and what role models play in binding and data access strategies
-
Demonstrates how to display and process forms
-
Covers the new features added in the April 2011 Tools Update, such as scaffolding and HTML5 project templates
-
Walks you through performing client and server validation of your models
-
Uncovers tips for making use of the membership, authorization, and security features
-
Highlights how TDD applies to ASP.NET MVC
wrox.com
Programmer Forums
Join our Programmer to Programmer forums to ask and answer programming questions about this book, join discussions on the hottest topics in the industry, and connect with fellow programmers from around the world.
Code Downloads
Take advantage of free code samples from this book, as well as code samples from hundreds of other books, all ready to use.
Read More
Find articles, ebooks, sample chapters, and tables of contents for hundreds of books, and more reference resources on programming topics that matter to you.
Wrox Professional guides are planned and written by working programmers to meet the real-world needs of programmers, developers, and IT professionals. Focused and relevant, they address the issues technology professionals face every day. They provide examples, practical solutions, and expert education in new technologies, all designed to help programmers do a better job.
About the Author
Phil Haack is a senior program manager at Microsoft on the Web Platform and Tools team. His areas of responsibility include ASP.NET MVC and NuGet.
Brad Wilson has nearly 20 years of experience in professional software development and web development. He currently works on the ASP.NET MVC project at Microsoft.
K. Scott Allen is the founder of OdeToCode LLC where he provides custom development, consulting, and mentoring services for clients around the world.
I'd like to read this book on Kindle
Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Product details
- Publisher : Wrox; 1st edition (July 22, 2011)
- Language : English
- Paperback : 432 pages
- ISBN-10 : 1118076583
- ISBN-13 : 978-1118076583
- Item Weight : 1.65 pounds
- Dimensions : 7.38 x 0.98 x 9.25 inches
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read author blogs and more
Customer reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
The first thing I always do is download the Errata from the publisher and make the corrections in my book. This doesn't even come close to covering all of the mistakes that you will find in this book! Also, some of the errors listed on the publishers "Errata" list are not errors at all (someone needs to vet the list).
Each author wrote one (or more) chapters but it is obvious that they did not read each others work. Instead, they assumed that certain information would be covered in other chapters. For example, on page 109 you will see this sentence, "The data annotations you saw in Chapter 4 can have a dramatic influence..." The problem is that data annotations are not covered in Chapter 4 (other than [HttpPost]). The author assumed annotations would be covered in Chapter 4 because that chapter covers the Model. Now, flip to the index and look up "Data Annotation" and it points you to Chapter 6. I could list dozens of these examples from throughout the book.
If you disagree with me then turn to Chapter 3 and see how many typos you can find in that chapter alone. Chapter 3 is a short Chapter (28 pages) and here are just a few....
>> Page 42, next to last paragraph starts with "Notice that unlike the sample in Code Snippet 3-3,...should say 3-2. Also, every code snippet reference throughout the chapter that references a snippet after 3-8 is wrong because snippets 3-9 and 3-10 are not provided....well actually they are but they are numbered 3-11 & 3-12 thus throwing off every number after that!
>> Page 45, last sentence, "...,you could create the ShoppingCartSummaryViewModel class, shown as follows: but then shows you a class called ShoppingCartViewModel....DOOHH!
>> Page 47, Two entire lines under Figure 3-3 are printed again in the first bullet that follows. Did anyone read this before it was printed?
>> Had enough yet? There are more. I didn't even list the Chapter 3 mistakes that are listed in the publisher's Errata listing (one of which is not a mistake at all).
If you are not going to take the time to proofread and edit your book, don't bother writing it in the first place!
That said, I purchased this book out with my own money, as a means to fill in any gaps in my MVC3 knowledge, and to get the authors' perspective on the most recent release of ASP.NET MVC. I am about halfway through the book, and I'm very pleased with it.
Unlike many multi-author books, it's very clear that Allen, Galloway, Haack, and Wilson coordinated closely on the content and code for the book. By using the MVC Music Store application consistently as the example for code samples, the reader gains more understanding of how the many pieces of an MVC 3 application fit together. One major step forward for this book (speaking as someone who's written books, and had to maintain the code samples that go along with them) is the use of the NuGet package manager to provide code samples for the book. This ensures that the authors can update the code samples easily, and that readers will always get the latest version of the code, without having to search for a URL, or browse around unnecessarily, or download and unzip a bunch of stuff to who knows where.
This may not be the right book for someone who's new to web development, as it does not purport to be for beginners. For those folks, there are lots of great resources at [...]to get you started. But if you have a basic grounding in ASP.NET MVC, or are an experienced Web Forms developer with a desire to learn what MVC3 is all about, this book is a good place to get solid information from folks who are building the product (Phil Haack and Brad Wilson) and those with a great deal of hands on experience writing code with it (Jon Galloway and K. Scott Allen).
As someone who's already worked on a project with the first version of MVC a couple of years back, this was a good refresher and a quick way to get to know all the new MVC3 features. This includes: Razor for Views; Validation mechanisms are much easier now, there used to be way too many options to pick from; jQuery Templates; NuGet etc.
Favorite Chapters:
- Ch.7 on Security, it's very well written with quick and easy to use solutions. Great stuff! MVC 1 & 2 developers need to fix a security hole in the default authentication template if you've used it.
- Ch.12 on Testing, good examples and valuable tips towards the end.
Least favorite Chapters are:
- Ch. 11 on Dependency Injection, it's extremely abstract and that's perfectly fine for the first section given the design pattern discussion, but it becomes harder to follow subsequently with not even a single attempt to show an IoC container in action with some real code. It just doesn't seem to accomplish its intended goal, unfortunately this chapter is poorly done, needs better examples and better ways to describe the problem it's trying to solve. It's a shame since this is a key concept for building complex MVC solutions.
- Ch. 9 on Routing, it's definitely more of a "under the hood" reference type chapter, doesn't mean it isn't important, just boring to read through.
Some chapters are missing the full source code but you could just google/download the MVC Music Store application which has most of it. Also, some examples include NuGet packages which is pretty convenient to load and run within Visual Studio 2010. Another really minor issue is that chapters probably need a bit more accompanying graphics/images which help set the context than just code/text for long stretches such as the AJAX chapter.
Worth mentioning that the book feels more like a reference book rather than a walk-through with step-by-step instructions so some sections however essential can make you want to skip some pages.
Overall, the book does what it's supposed to as far as new MVC 3 features; it will not however prepare you enough for any Production ready solutions i.e. solution architecture is MIA.
I would've liked a chapter on how to structure enterprise applications which as you'll find out are quite different from a base application like MVC Music Store. A couple of sample approaches would go a long way. Yes, there are some on codeplex but it would be better to hear from the "MVC elite" how they would design real-world complex solutions.
Top reviews from other countries
The first few chapters describe how MVC works, and the basics of how to use ASP.NET MVC3. These were brilliant, and I was able to get going quickly. It was obvious that I had only scratched the surface, and was very soon looking to take my knowledge from the simple, basic level to the level where I would be able to use it for real. That's where the book started to disappoint me.
The first problem was that the only way to get at the sample code was to use NuGet. No, you can't just download a zip file of ready-made VS solutions, you have to start a new solution, then use NuGet to add the code you want as a package. Apart from being painful and awkward, you can't add multiple code samples to one solution as the types and namespaces clash, so you end up wasting enormous amounts of time fiddling around trying to get the samples to work. This was VERY frustrating. In the end, I pretty much gave up with the sample code, which is not a positive experience.
The problem seems to be that the authors are obsessed with NuGet, and mercilessly push it whenever possible, seemingly oblivious to the fact that it is NOT the best answer to everything. What's even worse is that they devote (ie waste) an entire chapter explaining what NuGet is, how to use it and how to write your own NuGet packages. For goodness sake, why on earth is this in an ASP.NET MVC book? It has absolutely NOTHING to do with the subject of the book. By this time, it was no more than a four-star book.
The real disappointment came when I got to the chapters on more advanced topics, such as IoC/DI. These were so badly explained as to be a waste of time. I have done a fair bit of IoC/DI, and so knew what it was about before I started reading the chapter. The initial explanation was fairly clear, and I was looking forward to seeing how it fitted in to the ASP.NET MVC framework. Oh no, they aren't going to tell you that, it would be too easy! Sample code? No, you don't get that either. Their (poor) excuse is that as there are so many IoCs around, they can't show you how to use them all, so check the documentation for your chosen one to see how to use it. Well, how about giving us some idea of which ones are around, with some comments as to how good they are? How about choosing one and showing some sample code for that one? This would have made it much clearer, and is the way other books in this series do it (such as Professional Enterprise.NET (Wrox Programmer to Programmer) ). I was left little wiser than when I started the chapter.
To round off the poor quality of this chapter, they jump right in to telling you about the various interfaces you can implement to do your own IoC/DI code, without giving you any idea how to do it in practice, or (worse) why and when you might want to do this in the first place. The result is a confusing, unhelpful mess. This is a common feature of other chapters as well, where they describe (if I can use the word loosely) interfaces exposed by the framework, but don't tell you when or why you might want to implement them. There is no indication of where the standard, everyday stuff ends and the advanced, once-in-a-while stuff starts.
In fairness, the chapter on security was excellent. They clearly explain various forms of attack that can be made on your web site, and show how to defend yourself against them. Most of this wasn't specific to ASP.NET MVC, and probably could be read by any ASP.NET developer.
All in all, a major disappointment. I generally find that Wrox Pro books to be of a high standard, but this was an exception. It's a shame, as the introductory part was excellent, other than the pathetic mess they made of the sample code. This book needs some serious rewriting before it could become the book it promises to be.
Just a couple of weeks with this book and I already feel like a pro when it comes to MVC3 web programming.
Most of the time I have been reading this book away from the computer. It is after all a 'professional to professional' book, so quite rightly it doesn't get too bogged down in source code. (Maybe a few too many screenshots of dialogs at the beginning which shouldn't be necessary in a programmer to programmer book, but not too many so as to detract from the book as a whole).
It generally shows you just what is needed to illustrate what is required, and as an experienced programmer you don't actually need to download or execute the example code to know what it's going to do. (Just like a professional musician doesn't need to actually play a musical score to know what it will sound like on different instruments, etc).
But most of all, the text is readable. The tenor of the text is amenable and friendly, even quite humorous in places. Reading this book is a pleasure not a chore.
You can easily read it away from the computer, and still find yourself learning substantial amounts of stuff that you'll remember when you are later sat in front of your PC coding.
Admittedly I'm not sure that the chapter on NuGet is all that appropriate. This book claims to be about MVC3 so why it feels the need to include a whole chapter on a tool for downloading other packages, well, I'm not really convinced it should be in there. (Or perhaps should at least be relegated to a short appendix).
The chapter on dependency injection also feels a bit patronising for a programmer to programmer book, and also the chapter on unit testing also borders on the patronising, for the same reason. i.e. these are general programming aspects, not really specific to MVC3, and hence (IMHO) not really appropriate in a book dedicated to MVC3 that claims to be targetted at 'programmer-to-programmer'.
But that said, these aren't the main substance of the book. The main substance of the book is in the other chapters explaining the Model, View and Controller layers, and routing, and MVC security, and those chapters really are gold mines.
Perhaps if you already know MVC1 and MVC2 then maybe there isn't a lot of new stuff, so perhaps if that's the case you might be better just learning the differences online.
But if you don't know any version of MVC or even ASP, but do know desktop programming in C# inside out, then this book really comes into its own and is worth every penny.
The book's content is actually concise, to the point, and well-judged. It expertly covers best practice and practical guidance for developing professional MVC apps. That said, there are chapters on Dependency and Injection and Unit Testing which feel both superfluous and very useful at the same time, however the overall content is more than adequate.
An excellent book, written by people who clearly know what they're talking about.
Sometimes the authors skim over topics that might be useful if tackled in a deeper way. I doubt very much this is because the authors didn't know what they were talking about. I've read blogs by at least three of the authors and they certainly know their stuff. I definitely felt more time could have been spent on DI/IOC containers whilst the chapter on NuGet, whilst interesting enough could quite easily have been cut.
The only explanation for the large amount of errata that I can think of is that nobody proof-read the final drafts before it went off to be published. For one of the Wrox Professional series the number of mistakes is dreadful.
All that said, I'm still glad I bought the book and working through it has given me enough of a base to understand and really appreciate the work MS have done on MVC3. It's given me a good grounding in how to use the MVC 3 framework.
So next time chaps:
-- Talk to each other more.
-- Remove any content that is extraneous
-- Get someone interested in but unfamiliar with the technology to read your chapters and tell you if you need to go deeper
-- Don't let the book go to the presses until it has been proofread _properly_
It's difficult to see exactly who the book is targeted at. It's not really suitable for newcomers to MVC as there are some massive gaps in the breadth of material covered, with some important material receiving scant or no mention at all. It also lacks comprehensive examples, mostly just short unrelated code snippets so there's no feel for how everything fits together. Having said that most of the material presented is fairly basic so is unlikely to offer much to experienced MVC devs. Of the existing features covered I didn't find anything I didn't already know and on the contrary I often found myself thinking "I can't believe they haven't mentioned..."
What I personally really wanted from this book though was details on the new features and again the book fails to deliver. The chapter on Razor was ok, but not anything you couldn't find online and I found myself wanting more. I was grateful for an introduction to Nuget but it went far beyond what was appropriate for a book on MVC. Ironically this was probably the most detailed chapter despite being only tangentially related to the topic of the book. Special mention goes to the chapter on dependency injection, which is really stands out as particularly awful. MVC 3 introduces new hooks to make dependency injection easier, but rather than choose a DI container and show examples using that, the author states that because you can use any DI container he can't show any examples and just talks about the API in very high level terms. A complete waste of time.
If you are looking for an introduction to MVC there are much better books available. If you are looking for in-depth material you won't find it here. One to avoid I think.


