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

Appendix A. Reference Application— CarTrackr

The sample application included with this book is an application I have written for various demos of the ASP.NET MVC framework. You can read its short description and download the latest version from www.codeplex.com/CarTrackr.

CarTrackr is an online software application designed to help you understand and track your fuel usage and kilometers driven.

You will have a record on when you filled up on fuel, how many kilometers you got in a given tank, how much you have spent, and how many liters of fuel you are using per 100 kilometers.

CarTrackr will enable you to improve your fuel economy and save money, as well as conserve fuel. Fuel economy and conservation is becoming an important way to control your finances in the current time of high prices.

Please note that this appendix will not cover the CarTrackr sample application in its entirety, but will zoom in on certain aspects that make developing ASP.NET MVC applications easier and faster.

CarTrackr functionality

Before diving into the implementation details, the functionality of CarTrackr is explained by using the most important screens within the application.

Home page

The CarTrackr home page looks quite simple. It gives a description of the application's purpose and features, and allows a user to sign in or register an account.

When a user has logged in, the home page will display a link that redirects the user to his or her list of tracked cars.

Login screen

In order to use the CarTrackr features, a user must be logged in. Logging in can be done by using the login screen and providing either a username or password combination, or an OpenID login URL.

List of cars

The main screen, from which any action in the CarTrackr application can be performed, is the list of cars. It displays a list of all tracked cars linked to the user's account, and allows the user to show more details for a car, show refuellings, and so on. There's one special link on this page: Show statistics...

When a user clicks the Show statistics... link, a partial page update is performed by using an asynchronous web request (AJAX).

Car details

Whenever a user requests a car's details, the details page is displayed. This page displays the properties for the car, for example, its Make and Model, along with some statistical data, for example, the Average costs per kilometer that the car consumes, the Total kilometers, and so on.

On the car details screen, the user can scroll down to see some graphs, which immediately show the car's statistics in a more visual manner. For example, the Fuel usage over time is plotted on a Silverlight graph:

Refuellings list

If required, the user can display a list of all refuellings for a car's lifetime. These refuellings are listed in a table. The user can remove a specific refuelling, or add a new refuelling. For each refuelling, key data is presented along with a small logo of the refuelling station brand.