Learn your way! Get started

Building ASP.NET MVC 3 Applications Using VS 2010

with expert Don Kiely


Course at a glance

Included in these subscriptions:

  • Dev & IT Pro Video
  • Dev & IT Pro Power Pack

Release date 12/8/2011
Level Advanced
Runtime 11h 5m
Closed captioning N/A
Transcript N/A
eBooks / courseware Included
Hands-on labs Included
Sample code Included
Exams Included


Enterprise Solutions

Need reporting, custom learning tracks, or SCORM? Learn More



Course description

This course starts with an introduction to ASP.NET MVC and the Model-View-Controller pattern on which it is based. You will learn about the main differences between MVC and Web forms applications, see how to build a simple MVC application with Visual Studio, explore each of the three main components of an MVC application, and how to create controllers and actions to manage the workflow of an application. You will dig into action methods and results, explore models, see how to implement a model using both custom classes and Entity Framework data models, and how to centralize data validation using a model. Next you will get into views, how to create them, interact with data provided by the controller, how to add content to a view, and use HTML helpers to make it easier to build views. As you progress further you will explore how you can use action filters to keep your action methods pristine while implementing cross-cutting features, look at the Routing API and how MVC makes use of it to respond to Web requests and generate URLs for links in the application. Finally, MVC and AJAX are two great tastes that taste great together, and you will see how to use them together in an application to create a great user experience.

Prerequisites

This course assumes you are familiar with MVC 2 and using Visual Studio 2010.

Meet the expert

Don Kiely is a featured instructor on many of our SQL Server and Visual Studio courses. He is a nationally recognized author, instructor, and consultant specializing in Microsoft technologies. Don has many years of teaching experience, is the author or co-author of several programming books, and has spoken at many industry conferences and user groups. In addition, Don is a consultant for a variety of companies that develop distributed applications for public and private organizations.

Course outline



Module 1

VB and C# Differences (10:32)
  • Introduction (04:12)
  • Syntax Differences (01:25)
  • Lambda Expressions (02:28)
  • MVC Helper Methods (02:12)
  • Summary (00:14)
Introduction (31:08)
  • Introduction (00:58)
  • The MVC Architecture (02:55)
  • Anatomy of a Request (01:02)
  • ASP.NET MVC (02:23)
  • MVC and Web Forms Differences (06:54)
  • The Tenets of MVC (04:10)
  • Web Forms vs. MVC (02:43)
  • Blending of Concerns (01:33)
  • MVC Serves Methods, Not Files (03:02)
  • Testability (01:43)
  • Control Over HTML (02:03)
  • Open Source (01:14)
  • Summary (00:23)
Building an MVC Application (23:53)
  • Introduction (01:33)
  • MVC Project Templates (03:07)
  • Demo: MVC Test Application (04:49)
  • Demo: Configuration Change (01:44)
  • Demo: Explore Application (12:09)
  • Summary (00:30)

Module 2

Exploring An MVC Project (33:00)
  • Introduction (00:58)
  • Demo: Explore Application (19:00)
  • Demo: Explore Application (12:28)
  • Summary (00:34)
Upgrading MVC 2 to MVC 3 (13:03)
  • Introduction (01:32)
  • Upgrading (00:33)
  • Create a new MVC 3 App (02:17)
  • Copy Web.Config (02:44)
  • Version Attribute (01:06)
  • Adding Assemblies (01:34)
  • Edit Project File (02:39)
  • Summary (00:36)
Using a Controller (29:10)
  • Introduction (01:16)
  • Using a Controller Overview (00:42)
  • Controllers in System.Web.Mvc (01:40)
  • The IController Interface (01:31)
  • Demo: Using a Controller (02:19)
  • ControllerBase Abstract Base (01:26)
  • The Controller Class (02:24)
  • MVC Processing Pipeline (02:36)
  • Action Method Selection (01:34)
  • Action Method Qualifications (02:42)
  • ActionName Attribute (01:07)
  • Demo: Action Method (03:19)
  • ActionMethodSelector Attribute (02:26)
  • Demo: ActionMethodSelector (03:40)
  • Summary (00:21)

Module 3

Controller Actions (24:23)
  • Introduction (00:52)
  • Action Method Input (01:09)
  • Context Object Input (00:49)
  • Demo: Action Method (04:18)
  • Parameter Input (03:51)
  • Demo: Parameter Input (02:58)
  • Model Bindings (00:43)
  • Demo: Model Bindings (05:53)
  • Controller Session State (01:22)
  • Demo: Controller Session State (02:06)
  • Summary (00:18)
Action Results (37:24)
  • Introduction (01:41)
  • Action Result Overview (00:46)
  • Action Result Types (02:20)
  • Demo: View Result (08:36)
  • Passing Data to the View (01:21)
  • Demo: ViewData (08:13)
  • ContentResult: Returning Data (01:00)
  • Demo: ContentResult (01:36)
  • Implicit Action Results (00:55)
  • Demo: Implicit Action Results (02:20)
  • HttpNotFoundResult (00:49)
  • Demo: HttpNotFoundResult (03:19)
  • HttpStatusCodeResult (00:39)
  • Demo: HttpStatusCodeResult (01:41)
  • Redirection Methods (01:25)
  • Summary (00:35)

Module 4

Custom Models (20:41)
  • Introduction (01:59)
  • MVC Models (02:33)
  • Model"s Role in MVC (00:54)
  • Anatomy of a Request (01:03)
  • Building Models (01:27)
  • Createing a Custom Data Model (02:02)
  • Demo: Creating a Custom Model (10:00)
  • Summary (00:39)
Using a Model (12:03)
  • Introduction (00:43)
  • Demo: Create Methods (02:55)
  • Demo: Is Model State Valid (01:57)
  • Demo: Create View (01:08)
  • Demo: Edit Action Methods (01:45)
  • Demo: Edit View (00:24)
  • Demo: Details View (00:57)
  • Demo: Delete View (01:45)
  • Summary (00:25)
Create Entity Framework Model (30:05)
  • Introduction (01:19)
  • LINQ to SQL (01:20)
  • Entity Framework as MVC Model (00:33)
  • Demo: Create MVC Application (00:55)
  • Demo: Add New Item (25:30)
  • Summary (00:26)

Module 5

Data Validation (46:43)
  • Introduction (03:02)
  • Validation Attributes (03:37)
  • Demo: Validation Attributes (09:04)
  • Compare Attribute (00:27)
  • Demo: Compare Attribute (02:57)
  • AllowHtml Attribute (01:57)
  • Demo: AllowHtml Attribute (04:37)
  • Remote Attribute (00:30)
  • Demo: Remote Attribute (02:26)
  • Model-Level Validation (00:59)
  • Demo: Model-Level Validation (04:06)
  • Client and Server-Side (02:40)
  • Demo: Client and Server-Side (08:23)
  • Summary (01:55)
MVC Views (23:19)
  • Introduction (02:47)
  • Anatomy of a Request (00:46)
  • Web Forms View Engine (02:21)
  • Razor View Engine (05:33)
  • Comparing (02:31)
  • Demo: Views (08:33)
  • Summary (00:45)

Module 6

Creating and Using Views (25:57)
  • Introduction (01:11)
  • Demo: Creating Views (05:24)
  • Layout Pages (00:43)
  • Demo: Layout Pages (02:13)
  • Running Code Before a View (00:32)
  • Demo: Running Code (01:45)
  • Adding Content to a View (00:51)
  • Demo: Adding Content (01:54)
  • Content Result (01:06)
  • Demo: Content Result (02:06)
  • Inline Code (01:31)
  • Demo: Inline Code (04:17)
  • ViewData (02:02)
  • Summary (00:17)
Helper Methods + Partial Views (24:47)
  • Introduction (01:12)
  • Demo: Helper Methods (04:27)
  • Partial Views (01:03)
  • Demo: Partial Views (10:05)
  • RenderAction Components (02:50)
  • Demo: RenderAction Components (04:20)
  • Summary (00:47)
Intro to HTML Helpers (10:32)
  • Introduction (02:31)
  • HtmlHelper Class (02:37)
  • Types of HTML Helper Methods (00:24)
  • Untyped/Regular Helper Methods (00:27)
  • Strongly-Typed Helper Methods (01:38)
  • Templated Helper Methods (01:13)
  • Using View and Model Data (01:19)
  • Summary (00:20)

Module 7

Using HTML Helpers (33:00)
  • Introduction (00:24)
  • Form and Input Field Helpers (00:41)
  • Demo: Form/Input Field Helpers (04:11)
  • Input Elements Helpers (01:34)
  • Demo: Input Elements Helpers (25:53)
  • Summary (00:15)
Templated and Complex (25:36)
  • Introduction (01:36)
  • Demo: DisplayForModel (04:01)
  • Complex Helper Methods (00:35)
  • Demo: Complex Helper Methods (09:35)
  • Creating Custom Helpers (01:25)
  • Demo: Creating Custom Helpers (07:45)
  • Summary (00:36)

Module 8

Action Filters (45:29)
  • Introduction (02:45)
  • Types of Action Filters (01:12)
  • MVC Action Filters (03:26)
  • Authorize Action Filter (01:07)
  • Demo: Authorize Action Filter (11:16)
  • HandleError Action Filter (01:59)
  • Demo: HandleError Action Filter (09:29)
  • Breaking Change: Exception Filters (01:52)
  • OutputCache Action Filter (01:29)
  • Demo: OutputCache (06:42)
  • RequireHttps Action Filter (01:33)
  • Global Filters (00:59)
  • Demo: Global Filters (01:01)
  • Summary (00:31)
ASP.NET Routing (34:08)
  • Introduction (01:53)
  • MVC and Routing (01:48)
  • Two Components of Routing (01:08)
  • Jakob Neilson"s Guide to URLs (01:40)
  • URL Rewriting (03:15)
  • Matching URLs to Methods (02:04)
  • Defining Routes (00:49)
  • Demo: Routing (05:14)
  • The URL Pattern (02:05)
  • Demo: URL Pattern (13:35)
  • Summary (00:33)

Module 9

Routing Options (19:33)
  • Introduction (00:30)
  • Demo: Routing Options (11:25)
  • The-Catch-All Parameter (01:10)
  • Demo: Catch-All Parameter (03:14)
  • Limitations on Catch-All Param (01:10)
  • Stopping and Ignoring Routes (00:20)
  • Demo: Stopping and Ignoring (01:15)
  • Summary (00:26)
Generating URLs (20:37)
  • Introduction (01:36)
  • ActionLink and RouteLink (01:18)
  • Demo: ActionLink and RouteLink (11:18)
  • How the URL-Matching Algorithm Works (02:21)
  • Named Routes (00:20)
  • Demo: Named Routes (02:37)
  • Summary (01:04)
MVC And Ajax Together (36:11)
  • Introduction (01:45)
  • Potential Problems with Ajax (02:20)
  • MVC and Ajax Together (02:38)
  • Ajax Libraries (02:25)
  • The Microsoft Ajax Library (00:47)
  • jQuery in MVC Applications (03:35)
  • jQuery Files (03:17)
  • Which Version of jQuery? (03:38)
  • Modernizr (00:51)
  • Project Templates (01:06)
  • Use a Content Delivery Network (02:43)
  • Using CDN (01:49)
  • Unobtrusive JavaScript (01:10)
  • Separation of Functionality (01:55)
  • Demo: Unobtrusive JavaScript (05:39)
  • Summary (00:24)

Module 10

Java Script and Ajax Features (29:45)
  • Introduction (00:45)
  • Demo: Disabling scripting (12:54)
  • MVC"s Ajax Features (00:33)
  • Ajax Helper Methods (03:20)
  • AjaxHelper Class (00:57)
  • AjaxOptions Class (03:14)
  • Fetching Page Content with Ajax (00:12)
  • Demo: Ajax Features (06:23)
  • Summary (01:25)
Ajax Form and Action Results (24:11)
  • Introduction (00:46)
  • Demo:Ajax Form Features (11:07)
  • Ajax-Related Action Results (00:56)
  • Working With JSON Data (01:48)
  • Demo: JSON Data (09:10)
  • Summary (00:22)