Introduction

ASP.NET MVC is Microsoft’s newest technology for building web applications. Although ASP.NET MVC is new, there are already several large and successful websites that are built on the ASP.NET MVC framework including StackOverflow.com and parts of CodePlex.com.

ASP.NET MVC was created to appeal to several different audiences. If you are the type of developer who wants total control over every HTML tag and pixel that appears in a web page, the ASP.NET MVC framework will appeal to you.

ASP.NET MVC also enables you to expose intuitive URLs to the world. Exposing intuitive URLs is important for getting your website indexed by search engines. If you care about Search Engine Optimization, you will be happy with ASP.NET MVC.

The ASP.NET MVC framework enables you to build web applications that are easier to maintain and extend over time. The Model View Controller pattern encourages a clear separation of concerns. The framework encourages good software design patterns.

Finally, the ASP.NET MVC framework was designed from the ground up to support testability. In particular, the ASP.NET MVC framework enables you to practice test-driven development. You are not required to practice test-driven development when building an ASP.NET MVC application, but the ASP.NET MVC framework makes test-driven development possible.

How This Book Is Organized

The book is divided into two parts. The first part of the book describes the ASP.NET MVC framework feature-by-feature. For example, there are chapters devoted to the subject of controllers, caching, and validation.

The second part of this book contains a walkthrough of building a full ASP.NET MVC application: We build a simple blog application. We implement features such as data access and validation.

Because one of the primary benefits of the ASP.NET MVC framework is that it enables test-driven development, we build the blog application by using test-driven development. The blog application illustrates how you can overcome many challenges that you face when writing real-world applications with the ASP.NET MVC framework.

You can approach this book in two ways. Some readers might want to read through the first chapters of this book before reading the chapters on building the blog application. Other readers might want to read the walkthrough of building the blog application before reading anything else.

What You Should Know Before Reading This Book

I make few assumptions about your technical background. I assume that you know either the C# or the Visual Basic .NET programming language—all the code samples are included in both languages in the body of the book. I also assume that you know basic HTML.

ASP.NET MVC uses many advanced features of the C# and Visual Basic .NET language. The first appendix of this book, Appendix A, “C# and VB.NET Language Features,” contains an overview of these new features. For example, if you are not familiar with anonymous types or LINQ to SQL, you should take a look at Appendix A.

The other two appendixes, Appendix B, “Using a Unit Testing Framework,” and Appendix C, “Using a Mock Object Framework,” are devoted to explaining how to use the main tools of test-driven development. In Appendix B, you learn how to use both the Visual Studio Unit Test framework and how to use the NUnit Unit Test framework. Appendix C is devoted to Mock Object Frameworks.

Throughout the book, when a line of code is too long for the printed page, a code-continuation arrow ( image) has been used to mark the continuation. For example:

ReallyLongClassName.ReallyLongMethodName("Here is a value", "Here is another value")


What Software Do You Need?

You can download all the software that you need to build ASP.NET MVC applications by visiting the www.ASP.net/mvc website. You need to install three software components:

  1. Microsoft .NET Framework 3.5 Service Pack 1—The Microsoft .NET framework includes the Microsoft ASP.NET framework.
  2. Microsoft ASP.NET MVC 1.0—The actual ASP.NET MVC framework that runs on top of the ASP.NET framework.
  3. Microsoft Visual Web Developer 2008 Service Pack 1 or Microsoft Visual Studio 2008 Service Pack 1—The development environment for creating ASP.NET applications. Also includes the option of installing Microsoft SQL Server Express.

The Microsoft .NET framework, Microsoft ASP.NET MVC, and Microsoft Visual Web Developer are all free. You can build ASP.NET MVC applications without paying a single cent.

Instead of downloading and installing each of these software components one-by-one, you can take advantage of the Microsoft Web Platform Installer to manage the download and installation of all these components. You can launch the Microsoft Web Platform Installer from the www.ASP.net/mvc site.

Where Do You Download the Code Samples?

The code samples for the book are located on the book’s product page, www.informit.com/title/9780672329982.

If You Like This Book

After you read this book, if you discover that this book helped you to understand and build ASP.NET MVC applications, please post a review of this book at the www.Amazon.com website.

To get the latest information on ASP.NET MVC, I encourage you to visit the official Microsoft ASP.NET MVC website at www.ASP.net/mvc. I also encourage you to subscribe to my blog at StephenWalther.com that contains ASP.NET MVC tips and tutorials. I also use my blog to post any errata that is discovered after the book is published.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.98.153