Book Image

ASP.NET MVC 1.0 Quickly

By : Maarten Balliauw
Book Image

ASP.NET MVC 1.0 Quickly

By: Maarten Balliauw

Overview of this book

<p>Using WebForms has led to problems for ASP.NET developers, such as low testability and inconsistent code. These problems become increasingly relevant when trying to develop or maintain anything but the simplest web site.<br /><br />This book takes you through the ASP.NET MVC framework to help you simplify and build web applications quickly. With example applications built on best practices and with clear explanations, you will get started in no time.<br /><br />The MVC pattern is widely accepted as one of the best approaches for building modern web applications and Microsoft's new ASP.NET MVC Framework offers a fully supported way for developers to implement MVC in ASP.NET.<br /><br />This book takes you through the essential tasks to create powerful web applications as fast as possible. These essential tasks are explained clearly, with well-structured instructions. The book does not cover every single feature in detail; it provides precise information for you to get started, and takes you through the creation of an example application that covers MVC application design techniques.<br /><br />In addition to helping you write code, this book covers unit testing, to improve the stability and quality of the application you are building. It provides a quick reference to the MOQ framework to aid in unit testing. With this book, you will soon have the skills that will make you an ASP.NET developer to be reckoned with, and you will be creating applications with a speed that will astonish your colleagues and boss!</p>
Table of Contents (18 chapters)
ASP.NET MVC 1.0 Quickly
Credits
About the author
About the reviewers
Preface
ASP.NET MVC Mock Helpers

What is ASP.NET routing?


In a regular ASP.NET web application, each URL is mapped to a file on a disk. For example, a request for http://www.example.com/Products/Show.aspx?id=5 really maps to a file called Show.aspx on the web server's disk.

Using ASP.NET routing, you define specific patterns for a URL that map to a certain handler class that will take care of the request. For example, a URL in the form of http://www.example.com/Products/Show/5 could be matched with a pattern http://www.example.com/{controller}/{action}/{id}. The variables between { and } are populated with the actual values from the request URL, and will map to the HomeController and to the Index action if no other value can be deduced from the URL.

These URL patterns can also be used to programmatically create URLs that correspond to them. All hyperlinks in your ASP.NET MVC application can be generated this way and can thus easily be managed by maintaining the route table.