How To Take This Class

Course Overview

This course starts with an introduction to ASP.NET MVC and the Model-View-Controller pattern on which it is based. You’ll 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’ll 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’ll 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’ll 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’ll see how to use them together in an application to create a great user experience.

Course Prerequisites

This course assumes that students are familiar and experienced with Microsoft’s .NET Framework and ASP.NET development tools. They should be familiar with Web development and understand how HTTP and HTML work to produce Web pages for the user. Students should also have experience writing applications with ASP.NET 3.5 or later Web forms, and be familiar with how ASP.NET processes page requests, and have strong experience with .NET Framework 3.5 or later programming. Students 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.

Course Audience

This course is designed for experienced .NET developers interested in understanding and implement the MVC model in their web applications.

What You'll Learn

Upon successful completion of this course, students will be able to:
  • Understand differences between MVC and Web forms applications
  • Create controllers and actions to manage the workflow of an application
  • Write code to implement methods and results
  • Understand the limitless ways to provide data to an MVC application
  • Implement a model using both custom classes and Entity Framework data models
  • Centralize data validation using a model
  • Interact with data provided by the controller
  • Understand ways to add content to a view
  • Use HTML Helpers in MVC
  • Understand how action and custom filters are important for your application
  • Understand why you can be creative with naming of your Application URLs
  • Understand the importance and usage of Routing and Web Forms
  • Use AJAX and jQuery libraries to add functionality to your application without increasing development time
  • Work with JSON data

Course Duration

2 Days

Course Outline

  1. Introduction to ASP.NET MVC
    • The Model-View-Controller Pattern
    • Differences between MVC and Web Forms Applications
    • Building a Simple MVC Application with Visual Studio
    • Working with Controllers and Actions
  2. Introduction to Controllers
    • Using a Controller to Manage the Application
    • Controller Actions
    • Returning Action Results
    • Creating MVC Models
  3. Data and Business Rules in MVC Applications
    • Creating a Custom Data Model
    • Creating an Entity Framework Model
    • Data Validation and Data Annotations
    • Using MVC Views
  4. Views in ASP.NET MVC
    • Adding Content to a View
    • HTML Helpers and Action Filters
  5. Introduction to HTML Helpers
    • Using HTML Helpers
    • Action Filters
    • Routing and URLs
  6. Introduction to ASP.NET Routing
    • Matching URLs to Methods
    • Generating URLs
  7. Using MVC with AJAX and jQuery
    • MVC and AJAX: Made for Each Other
    • MVC's AJAX Features