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

Summary


In this appendix, some tips and tricks for building a real-life ASP.NET MVC application were covered, using the CarTrackr sample application, by zooming in on certain aspects that make developing ASP.NET MVC applications easier and faster. Using LINQ to SQL in a flexible manner, combined with the repository design pattern and dependency injection, provides the application with a flexible manner for coping with future requirements, and facilitates easier unit testing using mock data sources.

The ASP.NET MVC framework uses the ASP.NET provider model: authentication, authorization, membership, and session data. Developers can re-use ASP.NET code based on the provider model in ASP.NET MVC applications. In the CarTrackr application, a custom sitemap provider is developed and used as the default sitemap provider for standard ASP.NET controls.

CarTrackr uses the ASP.NET MVC Membership Starter Kit project to provide OpenID authentication on the login page.

Server-side form validation scenarios were explained by using an EnsureValid method on the domain objects. This method provides a list of possible error messages, which can be mapped to the ModelState dictionary of ViewData and used in the view for displaying error messages.