Course Overview
This course provides a practical hands-on introduction to developing Web applications using ASP.NET MVC 5 and C#. This Web development framework from Microsoft emphasizes separation of concerns in the architecture and testability of applications. The course includes coverage of the Razor View Engine, Entity Framework 6 and ASP.NET Web API 2. It also introduces Windows Azure and the deployment of ASP.NET MVC applications to the Azure cloud. The course covers the fundamentals of the Model-View-Controller design pattern and its implementation in ASP.NET MVC. This technology is compared with classical ASP.NET Web Forms. The two technologies share a common ASP.NET infrastructure. Visual Studio 2019 with .NET 4.7.2 is used as a productive platform for creating ASP.NET MVC applications. After presenting the fundamentals of the technology with several examples, the main components of Model, Controller and View are covered in detail. The discussion of the Model incorporates modern Microsoft data access technologies, i
Requirements
- The student should have a good working knowledge of C# and the .NET Framework. Basic knowledge of ASP.NET and HTML is also required.
Target audiences
- Experienced application developers or architects responsible for Web applications in a Microsoft environment.
Curriculum
- 1 Section
- 10 Lessons
- 3 Days
- Topics10
- 1.1Introduction to ASP.NET MVC Review of ASP.NET Web Forms Advantages of ASP.NET Web Forms Disadvantages of ASP.NET Web Forms Model-View-Controller Pattern ASP.NET MVC Advantages of ASP.NET MVC Disadvantages of ASP.NET MVC Goals of ASP.NET MVC Unit Testing Summary
- 1.2Getting Started with ASP.NET MVC An ASP.NET Core MVC Testbed Visual Studio ASP.NET MVC Demo Configure your project ASP.NET documentation page Starter Application Simple App with Controller Only Action Methods and Routing Action Method Return Type Rendering a View Creating a View in Visual Studio The View Web Page Dynamic Output Razor View Engine Embedded Scripts Embedded Script Example Using a Model with ViewBag Controller Using Model and ViewBag View Using Model and ViewBag Using Model Directly A View using Model in Visual Studio View created by Visual Studio Passing Parameters in Query String Lab 2 Summary
- 1.3ASP.NET MVC Architecture The Controller in ASP.NET MVC The View in ASP.NET MVC The Model in ASP.NET MVC How MVC Works Using Forms HTML Helper Functions Handling Form Submission Model Binding Greet View Input Validation Nullable Type Checking Model Validity Validation Summary Lab 3 Summary
- 1.4The Model Microsoft Technologies for the Model Small Pub Database ADO.NET Language Integrated Query (LINQ) ADO.NET Entity Framework EDM Example SmallPub Tables SmallPub Entity Data Model Entity Data model concepts LINQ to Entities Demo A LINQ Query IntelliSense Controller Using a Parameter Modifying a Data Source LINQ to Entities Insert Example LINQ to Entities Delete Example Lab 4 ADO.NET MVC Database Clients ADO.NET MVC CRUD Demo NuGet Package Manager Entity Framework 6 via NuGet Summary
- 1.5The Controller Controller Interface A Low-Level Controller Displaying Context Add and Subtract Controller Base class Home Controller Math Controller Receiving Input Binding Example Non-Nullable Parameters Nullable Parameters Using a Model Action Results Action Result Example Output Demo JavaScript Object Notation Action Method Attributes HTML Output Filters Asynchronous Controllers Lab 5 Summary
- 1.6The View View Responsibility A Program with a View View Page Passing Data to the View Dynamic and ExpandoObject Passing Lists to the View HTML Helper Methods Link-Building Helpers Form Helpers Html Helper Example Validation Helpers Templated Helpers Validation in Model Validation in Controller ValidtionMessage Helper Running the Example Lab 6 Summary
- 1.7Routing ASP.NET Routing Routing in ASP.NET Core MVC Simple Route Example Math Controller Default Values for URL Parameters Using a Default Route Home Controller Assigning Parameter Values Controller Code View Code Running the Example Properties of Routes Optional Parameter Matching URLs to Route Defaults Multiple Routes Example Attribute Routing Combining Routes Empty String for Route Attribute Token Replacement Areas Demo Areas Summary
- 1.8Unit Testing Test Driven Development Functional Tests Test Automation Refactoring Regression Testing Unit Testing in ASP.NET MVC MVC Unit Test Example The Model Testing the Model Assertions Visual Studio Unit Framework Assert Class Assert.AreEqual Lab 8B Summary
- 1.9Security Web Security Input Forgery Cross-Site Scripting Cross-Site Scripting Example Session Hijacking Cross-Site Request Forgey XSRF Example Controller and Model Code View Code Attacker Code The Defense SQL Injection Using the MVC Framework Securely Authorize Attribute Child Action Only Attribute RequireHTTps Attribute ValidateInput Attribute Summary
- 1.10Combining ASP.NET ASP.NET Web API ASP.NET and Azure Appendix A Learning Resources Appendix B Deployment in IIS 7.5
