Learn your way! Get started

ASP.NET MVC 2 and 3 Using Visual Basic 2010

with expert Don Kiely


Course at a glance

Included in these subscriptions:

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

Release date 2/5/2011
Level Advanced
Runtime 11h 2m
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

ASP.NET MVC is a fascinating technology that provides an alternative to Web forms for building Web applications. Instead of building pages using server controls that provide relatively little control over the HTML they produce, MVC gives you complete control. The 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, and see how to build a simple MVC application with Visual Studio. Then you will explore each of the three main components of an MVC application. Next, you will explore models, which encapsulate the data and business rules of an application. You will learn that there are almost no limitations in how you provide data to an MVC application. Then you will get into views, the user interface of an MVC application. Next, you will explore models, which encapsulate the data and business rules of an application. You will learn that there are almost no limitations in how you provide data to an MVC application. Then you will get into views, the user interface of an MVC application. You can use HTML helpers to make it easier to build views, and you will explore these nice little time savers that do not make you lose control over the HTML in your pages. And then you will explore how you can use action filters to keep your action methods pristine while implementing cross-cutting features. Next, you will 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. 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. Finally, the last section of the course will look at the newest version, MVC 3, which is built on top of earlier versions.

Prerequisites

MVC2 (This course assumes that you are familiar and experienced with Microsoft’s .NET Framework and ASP.NET development tools. You should be familiar with Web development and understand how HTTP and HTML work to produce Web pages for the user. You should have experience writing applications with ASP.NET 3.5 or later Web forms, be familiar with how ASP.NET processes page requests, and have strong experience with .NET Framework 3.5 or later programming. You should have experience with Visual Studio 2008 or later for building Web application projects. Experience with building database applications using these tools will be helpful, although not strictly necessary.) MVC 3 (You should be familiar with MVC 2 and using Visual Studio 2010.)

Learning Paths

This course will help you prepare for the following certification and exam:
MCTS: .NET Framework 4, Web Applications
70-515: TS: Web Applications Development with Microsoft .NET Framework 4

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

Introduction (31:40)
  • Introduction (03:19)
  • The MVC Architecture (03:37)
  • Anatomy of a Request (00:48)
  • ASP.NET MVC (01:43)
  • Diff Between MVC & Web Forms (06:17)
  • The Tenets of MVC (03:22)
  • Web Forms vs. MVC (12:07)
  • Summary (00:24)
Building an MVC Application (23:44)
  • Introduction (01:36)
  • MVC Project Templates (02:33)
  • Demo: Default MVC Web App (04:29)
  • Demo: Application Structure (08:27)
  • Demo: Implementing the App (06:35)
  • Summary (00:02)
MVC Code (23:30)
  • Introduction (00:15)
  • Demo: MVC Code (06:28)
  • Demo: MVC Views (07:16)
  • Demo: MVC Models (05:48)
  • Demo: MVC Testing (03:07)
  • Summary (00:35)

Module 2

Controllers (27:02)
  • Introduction (01:23)
  • Manage App Using Controller (00:40)
  • Controllers System.Web.Mvc (01:34)
  • The IController Interface (01:19)
  • Demo: IController Interface (02:01)
  • Controller Abstract Base Class (01:17)
  • The Controller Class (02:20)
  • MVC Request Process Pipeline (02:51)
  • Action Method Selection (01:56)
  • Action Method Qualifications (02:23)
  • ActionName Attribute (01:21)
  • Demo: ActionName Attribute (02:52)
  • ActionMethodSelector Attribute (01:59)
  • Demo: ActionMethodSelector (02:39)
  • Summary (00:22)
Controller Actions (16:37)
  • Introduction (00:51)
  • Action Method Input (00:58)
  • Context Object Input (00:37)
  • Demo: Context Object Input (02:14)
  • Parameter Input (03:00)
  • Demo: Parameter Input (01:59)
  • Model Bindings (00:53)
  • Demo: Model Bindings (06:00)
  • Summary (00:02)
Action Results (26:43)
  • Introduction (00:15)
  • Returning Action Results (02:05)
  • Action Result (00:45)
  • ActionResult Types (03:08)
  • Demo: ActionResult Types (02:49)
  • Demo: Finding Appropriate View (03:10)
  • Demo: Passing Data to the View (04:04)
  • Demo: Content Result (06:03)
  • Demo: JavaScript Result (03:47)
  • Summary (00:35)

Module 3

Data and Business Rules (29:51)
  • Introduction (02:30)
  • MVC Models (02:29)
  • Models Role in MVC (01:02)
  • Anatomy of a Request (01:03)
  • Building Models (01:38)
  • Creating a Custom Data Model (00:38)
  • Demo: MVC Models (03:01)
  • Demo: MVC Model Interaction (01:11)
  • Demo: Action Method (01:18)
  • Demo: Index View (06:15)
  • Demo: Editing Views (06:18)
  • Demo: Deleting Views (01:37)
  • Summary (00:44)
Entity Framework Model (34:31)
  • Introduction (01:18)
  • LINQ to SQL (01:29)
  • Entity Framework MVC Model (00:48)
  • Demo: Framework MVC Model (09:18)
  • Display a List of Products (00:26)
  • Demo: Product Controller (04:23)
  • Demo: Create the View (06:58)
  • Demo: Editing Features (09:46)
  • Summary (00:02)
Data Validation (19:18)
  • Introduction (00:15)
  • Validation and Annotations (03:46)
  • Validation Attributes (03:04)
  • Demo: Validation (06:36)
  • Client-Side Validation (01:13)
  • Demo: Client Validation (03:46)
  • Summary (00:35)

Module 4

Views (28:19)
  • Introduction (03:16)
  • MVC View Engine (02:09)
  • Anatomy of a Request (01:09)
  • Default View Engine (01:08)
  • Creating Views (00:52)
  • Demo: Creating View (04:39)
  • Adding Content to a View (00:46)
  • Demo: Adding Content (01:40)
  • Content Result (01:06)
  • Demo: Content Result (02:52)
  • Inline Code (01:33)
  • Demo: Inline Code (03:45)
  • Code Nugget Syntax (01:21)
  • ViewData (01:54)
  • Summary (00:02)
HTML Helper Methods (25:35)
  • Introduction (00:15)
  • HTML Helper Methods (01:20)
  • Demo: HTML Helpers (03:40)
  • Partial Views (02:19)
  • Demo: Partial Views (09:26)
  • RenderAction Components (02:47)
  • Demo: RenderAction (05:19)
  • Summary (00:26)

Module 5

HTML Helpers (44:03)
  • Introduction (03:21)
  • HtmlHelper Class (02:44)
  • HTML Helper Methods (01:33)
  • Using View and Model Data (01:22)
  • Adding Arbitrary Attributes (01:26)
  • Demo: Arbitrary Attributes (02:40)
  • Using HTML Helpers (01:10)
  • Demo: Using HTML Helpers (07:05)
  • Input Element Helpers (01:32)
  • Demo: Input Element Helpers (21:04)
  • Summary (00:02)
Strongly Typed and Template (34:33)
  • Introduction (00:15)
  • Strongly Typed Helpers (01:58)
  • Demo: Strongly Typed Helpers (04:01)
  • Other HTML Helpers (02:33)
  • Demo: Other HTML Helpers (07:41)
  • Templated Helper Methods (02:16)
  • Demo: Templated Helper (04:55)
  • Creating Custom Helpers (01:04)
  • Demo: Custom Helpers (09:44)
  • Summary (00:02)
Action Filters (41:35)
  • Introduction (00:15)
  • Action Filters (02:48)
  • MVC Action Filters (04:02)
  • Authorize Action Filter (01:12)
  • Demo: Authorize Filter (12:51)
  • HandleError Action Filter (02:12)
  • Demo: HandleError Filter (09:49)
  • OutputCache Action Filter (01:07)
  • Demo: OutputCache Filter (04:16)
  • RequireHttps Action Filter (01:12)
  • Demo: RequireHttps Filter (01:18)
  • Summary (00:28)

Module 6

Routing (38:59)
  • Introduction (01:52)
  • MVC and Routing (01:52)
  • Two Components of Routing (01:26)
  • Guide to URLs (01:32)
  • URL Rewriting (03:23)
  • Matching URLs to Methods (02:30)
  • Defining Routes (00:53)
  • Demo: Routing (05:58)
  • URL Pattern (02:19)
  • Demo: URL Pattern (09:07)
  • Demo: Default Values (08:00)
  • Summary (00:02)
Routing and Generating URLs (38:23)
  • Introduction (00:15)
  • Constraints (01:04)
  • Demo: Constraints (10:47)
  • Catch-All Parameter (01:11)
  • Demo: Catch-All Parameter (03:11)
  • Limitations (01:03)
  • Stopping + Ignoring Routes (00:29)
  • Demo: Ignoring Routes (01:58)
  • Generating URLs (01:45)
  • ActionLink + RouteLink (01:19)
  • Demo: Generate URLs (09:47)
  • URL-Matching Algorithm (02:18)
  • Named Routes (00:16)
  • Demo: Named Routes (01:52)
  • Summary (01:01)

Module 7

MVC and Ajax (35:12)
  • Introduction (01:41)
  • Problems with Ajax (01:43)
  • MVC and Ajax Together (02:43)
  • Ajax Libraries (02:59)
  • Microsoft Ajax Library (02:15)
  • Ajax Library Files (02:37)
  • jQuery in MVC Applications (02:58)
  • jQuery Files (01:59)
  • When JavaScript is Disabled (00:50)
  • Demo: Degrading (15:21)
  • Summary (00:02)
MVC Ajax Features (16:35)
  • Introduction (00:15)
  • MVC Ajax Features (00:35)
  • Ajax Helper Methods (03:18)
  • AjaxHelper Class (00:57)
  • AjaxOptions Class (02:58)
  • Fetching Page Content (00:17)
  • Demo: Fetching Content (06:08)
  • Demo with Firebug (02:00)
  • Summary (00:02)
Submitting Ajax Forms (29:07)
  • Introduction (00:15)
  • Submitting Form with Ajax (00:36)
  • Demo: Submitting Form (02:50)
  • Demo: GetDog View (03:18)
  • Demo: Null response (04:43)
  • Ajax-Related Action Results (00:19)
  • Working with JSON Data (01:14)
  • Demo: JSON Data (09:30)
  • Invoking JavaScript (00:49)
  • Demo: Invoking JavaScript (04:48)
  • Summary (00:41)

Module 8

MVC 3 and Razor (33:56)
  • Introduction (02:24)
  • Breaking Change (01:58)
  • Upgrading from MVC 2 to 3 (02:01)
  • Demo: Converting to MVC 3 (09:45)
  • The Razor View Engine (01:18)
  • Razor Design Goals (02:07)
  • Using Razor (01:10)
  • The Razor Syntax (01:27)
  • Demo: Razor View (07:37)
  • Layout Pages (00:42)
  • Demo: Layout Pages (03:20)
  • Summary (00:02)
New MVC 3 Features (21:57)
  • Introduction (00:15)
  • New Features from Old (00:29)
  • Demo: New Features (03:05)
  • Model Validation (01:33)
  • Demo: Model Validation (03:06)
  • SkipRequestValidation (01:56)
  • Demo: SkipRequestValidation (07:25)
  • Remote Attribute (00:31)
  • Demo: Remote Attribute (03:30)
  • Summary (00:02)
View and Controller Changes (40:55)
  • Introduction (00:15)
  • New Helper Methods (01:06)
  • Demo: New Helper Methods (07:39)
  • Running Code Before a View (00:27)
  • Demo: Code Before a View (01:40)
  • Controller Enhancements (00:54)
  • Demo: Controller Enhancements (05:16)
  • New Redirection Methods (01:17)
  • Global Filters (01:34)
  • Demo: Global Filters (04:23)
  • Partial Page Output Caching (00:47)
  • Demo: Output Caching (02:14)
  • Controller Session State (01:23)
  • Demo: Session State (01:24)
  • JavaScript and Ajax (01:12)
  • Separation of Functionality (01:48)
  • Demo:JavaScript Enhancements (07:07)
  • Summary (00:21)