Modern Web Development with ASP.NET Core Razor

This hands-on course teaches intermediate developers how to build modern, maintainable web applications using ASP.NET Core Razor Pages—without relying on Azure. Through structured lessons and real-world labs, students will master page routing, model binding, database integration with Entity Framework Core, authentication, reusable UI components, secure file uploads, and application configuration. Ideal for developers transitioning from MVC or starting fresh with Razor Pages, this course provides practical experience using familiar databases like AdventureWorks and TailspinToys in a local environment.


Target Audience

Intermediate C# developers using Visual Studio 2022 who want to build robust, database-connected web applications with Razor Pages—without Azure dependencies.

 

What You'll Learn

This course covers:

  • Razor Pages architecture and request lifecycle

  • Forms, model binding, and input validation

  • Configuration management and EF Core integration

  • CRUD operations with full user flow

  • Reusable components with partial views and tag helpers

  • User authentication and role-based access

  • Middleware, error handling, and structured logging

  • File upload functionality and runtime configuration


Hands-On Labs

Each lesson features a self-contained, real-world lab. You'll:

  • Build responsive page layouts and route navigation

  • Validate and process forms with complex models

  • Query AdventureWorks data using EF Core

  • Implement full CRUD operations on TailspinToys products

  • Secure pages using ASP.NET Core Identity

  • Create reusable components for data display

  • Handle errors and log requests

  • Upload and serve brochures securely from file system


 

Why Enroll?

Skip the complexity of MVC and cloud-first projects—this course focuses on what developers need to know to build Razor Pages applications efficiently in traditional enterprise environments. You’ll walk away with ready-to-deploy skills, project-ready code, and the ability to build scalable web apps using the latest ASP.NET Core tools.

Category: Software Development
Level: Intermediate
Course Code: ASPNET-RAZOR
Duration: 12h 0m
Price: $99.99 for 6 months
Tokens Required: 1
Access Duration: 6 months
Lab Environment: ✓ Included

Course Curriculum

Lesson 1: Introduction to ASP.NET Core & Razor Pages

This lesson introduces the foundational concepts of ASP.NET Core and the Razor Pages development model. Students will explore the request pipeline, compare Razor Pages to MVC, and learn how the page lifecycle works. Key topics include routing conventions, layout usage, and Razor syntax such as directives and expressions. The lab guides learners through building a new Razor Pages site with a shared layout and basic navigation. Additional concepts such as static file hosting and middleware configuration are also introduced to ensure a strong foundation.

Estimated Duration: 1 h 30 m

Hands-On Exercises

Exercise 1: Creating Your First Razor Pages Project
In this first exercise, you'll create a new ASP.NET Core Razor Pages project and explore the basic project structure. This will give you hands-on experience with the fundamental architecture of Razor Pages applications.
Estimated Time: 15 minutes
Exercise 2: Understanding Project Structure and Running Your First Application
In this exercise, you'll run your newly created Razor Pages application and explore the default project structure to understand how ASP.NET Core organizes files and handles requests.
Estimated Time: 15 minutes
Exercise 3: Customizing Layout and Creating Navigation
In this exercise, you'll modify the shared layout to create a custom navigation structure and understand how Razor Pages uses layouts to maintain consistent UI across pages.
Estimated Time: 15 minutes
Exercise 4: Exploring Razor Syntax and Adding Dynamic Content
In this exercise, you'll learn essential Razor syntax features and add dynamic, server-generated content to your pages. This will demonstrate how Razor Pages blend server-side C# code with HTML markup.
Estimated Time: 15 minutes

Lesson 2: Forms, Model Binding, and Validation

In this lesson, students dive into the form-handling capabilities of Razor Pages. They’ll learn how to use page handlers for GET and POST requests, bind complex models to form input, and implement server-side validation using data annotations. The hands-on lab focuses on building a contact form with robust validation and feedback. Learners will also explore tag helpers, anti-forgery tokens, and options for customizing validation summaries and error messaging.

Estimated Duration: 1 h 30 m

Hands-On Exercises

Exercise 1: Understanding Page Handlers and Form Basics
In this exercise, you'll learn how Razor Pages handles different HTTP methods through page handlers and create your first interactive form. You'll understand the fundamental concepts of GET and POST operations in web applications.
Estimated Time: 15 minutes
Exercise 2: Implementing Server-Side Validation with Data Annotations
In this exercise, you'll add robust server-side validation to your contact form using Data Annotations. This ensures that only valid data is processed and provides meaningful feedback to users when validation fails.
Estimated Time: 30 minutes
Exercise 3: Anti-Forgery Tokens and Advanced Form Features
In this exercise, you'll implement security best practices with anti-forgery tokens and explore advanced form features like multiple submit buttons, file uploads, and form persistence. These features are essential for production web applications.
Estimated Time: 15 minutes
Exercise 4: Complex Model Binding and Form Collections
In this final exercise for Lesson 2, you'll learn how to bind forms to complex objects, handle collections of data, and work with nested models. These skills are essential for building sophisticated business forms and data entry applications.
Estimated Time: 15 minutes

Lesson 3: Configuration and Database Access with EF Core

This lesson focuses on application configuration and database integration. Students will learn how to read settings from appsettings.json, apply environment-specific configurations, and inject configuration services into their pages. Using Entity Framework Core, they’ll connect to a SQL Server database, define a DbContext, and query data using LINQ. The lab demonstrates how to retrieve and paginate customer data from the AdventureWorks database, setting the stage for building data-driven applications.

Estimated Duration: 1 h 30 m

Hands-On Exercises

Exercise 1: Configuration Management with appsettings.json
In this exercise, you'll learn how to manage application configuration using appsettings.json files, environment-specific settings, and the ASP.NET Core configuration system. This foundation is essential for database connections and other application settings.
Estimated Time: 20 minutes
Exercise 2: Setting Up Entity Framework Core and Database Context
In this exercise, you'll install Entity Framework Core, create your first DbContext, and establish a connection to SQL Server. You'll also learn about the Code First approach and database migrations.
Estimated Time: 20 minutes
Exercise 3: LINQ Queries and Data Retrieval with Search and Paging
In this exercise, you'll learn how to use LINQ with Entity Framework Core to query your database effectively. You'll implement search functionality, sorting, and paging - essential features for any data-driven application.
Estimated Time: 20 minutes
Exercise 4: Advanced LINQ Operations and Related Data Loading
In this final exercise for Lesson 3, you'll explore advanced LINQ operations including joins, grouping, aggregations, and efficient loading of related data. You'll also learn about different loading strategies in Entity Framework Core.
Estimated Time: 20 minutes

Lesson 4: CRUD Operations with Razor Pages

Students learn how to build full Create, Read, Update, and Delete (CRUD) workflows using Razor Pages and Entity Framework Core. This lesson covers form binding with existing data, redirecting with TempData, handling concurrency conflicts, and managing errors gracefully. The lab walks students through building a complete product management system using the TailspinToys product table, including listing, editing, deleting, and sorting records. Best practices for user feedback and error handling are reinforced.

Estimated Duration: 1 h 30 m

Hands-On Exercises

Exercise 1: Creating New Records with Form Validation
In this exercise, you'll learn how to implement Create operations in a Razor Pages application. You'll build forms for creating new customers and orders while handling validation, error scenarios, and user feedback effectively.
Estimated Time: 20 minutes
Exercise 2: Reading and Displaying Data with Related Information
In this exercise, you'll implement comprehensive Read operations, including detailed views that display related data, formatted output, and user-friendly data presentation. You'll learn how to efficiently load and display complex data relationships.
Estimated Time: 20 minutes
Exercise 3: Updating Existing Records with Validation and Conflict Handling
In this exercise, you'll implement Update operations for both customers and orders. You'll learn about handling concurrency conflicts, partial updates, and maintaining data integrity during updates.
Estimated Time: 20 minutes
Exercise 4: Implementing Safe Delete Operations with Confirmation and Cascade Handling
In this final exercise for Lesson 4, you'll implement Delete operations with proper safety measures, cascade handling, and soft delete patterns. You'll learn how to handle related data and provide users with clear information about delete consequences.
Estimated Time: 20 minutes

Lesson 5: Reusable UI with Partial Views, Tag Helpers, and Layouts

This lesson introduces techniques for building modular, maintainable UI components. Students will create partial views, use and customize tag helpers, and understand how to structure shared UI using layout nesting. The lab focuses on building a reusable product card display using TailspinToys data. Students will walk away with the ability to build flexible UI elements like filter panels and reusable display components, promoting clean and DRY (Don’t Repeat Yourself) code.

Estimated Duration: 1 h 30 m

Hands-On Exercises

Exercise 1: Project Setup and Database Connection
Set up a new ASP.NET Core Razor Pages project and establish a connection to the TailspinToys2020-US database to work with Product data.
Estimated Time: 20 minutes
Exercise 2: Basic Product Listing Page
Create a basic product listing page that displays products from the TailspinToys2020-US database. This will serve as the foundation for implementing partial views in the next exercise.
Estimated Time: 20 minutes
Exercise 3: Creating Your First Partial View
Extract the product card display logic from the Products page into a reusable partial view. This demonstrates how partial views promote code reuse and maintainability across your application.
Estimated Time: 20 minutes
Exercise 4: _ViewImports Configuration and Custom Tag Helpers
Learn how to customize `_ViewImports.cshtml` for global view configuration and create custom tag helpers to enhance your UI components with reusable, declarative markup.
Estimated Time: 20 minutes

Lesson 6: Authentication and Authorization

Security takes center stage in this lesson. Students will integrate ASP.NET Core Identity into their project to enable user registration, login, and role management. The lab guides learners in securing an admin section of the site that manages customer records, ensuring only authenticated users have access. The lesson also covers role-based and policy-based authorization, user claims, and common identity-related patterns for building secure Razor Pages apps.

Estimated Duration: 1 h 30 m

Hands-On Exercises

Exercise 1: Project Setup and ASP.NET Core Identity Integration
Set up a new ASP.NET Core Razor Pages project and integrate ASP.NET Core Identity for user authentication and authorization. This exercise establishes the foundation for securing pages and managing user access in a web application.
Estimated Time: 30 minutes
Exercise 2: Role-Based Authorization and Admin Areas
Implement role-based authorization using ASP.NET Core Identity roles, create administrative areas with different access levels, and build user management functionality. This exercise demonstrates how to control access to different parts of an application based on user roles and permissions.
Estimated Time: 20 minutes
Exercise 3: Policy-Based Authorization and Claims-Based Security
Implement advanced authorization using policy-based authorization and claims-based identity. This exercise demonstrates how to create custom authorization policies, implement claims-based permissions, and build sophisticated access control logic that goes beyond simple role-based authorization.
Estimated Time: 20 minutes

Lesson 7: Middleware, Error Handling, and Logging

Students will learn how middleware enables request processing customization and how to log application activity effectively using ILogger<T>. They’ll implement structured error handling using built-in mechanisms like UseExceptionHandler and UseStatusCodePages. In the lab, students will build a custom middleware component to log incoming requests and create friendly error pages for 404 and 500 errors. The lesson also introduces file-based logging and techniques for environment-specific error handling.

Estimated Duration: 1 h 30 m

Hands-On Exercises

Exercise 1: Project Setup and Basic Middleware Configuration
Set up a new ASP.NET Core Razor Pages project and understand the basic middleware pipeline configuration. This exercise establishes the foundation for implementing custom middleware, error handling, and logging features.
Estimated Time: 20 minutes
Exercise 2: Performance Monitoring and Exception Handling Middleware
Enhance the middleware pipeline with performance monitoring capabilities and implement comprehensive exception handling middleware to gracefully manage errors and provide detailed logging for debugging purposes.
Estimated Time: 20 minutes
Exercise 3: Custom Error Pages and Status Code Handling
Create user-friendly custom error pages and implement comprehensive status code handling while maintaining detailed logging for developers. This exercise demonstrates how to provide a polished user experience for errors while preserving diagnostic information.
Estimated Time: 20 minutes
Exercise 4: Advanced Logging with Serilog and Log Analysis
Implement advanced logging configurations using Serilog, add file-based logging with rotation, and create log analysis and monitoring features. This exercise demonstrates production-ready logging practices and log management strategies.
Estimated Time: 20 minutes

Lesson 8: File Uploads, App Settings, and Course Wrap-Up

The final lesson introduces file upload handling, secure static file access, and advanced configuration techniques. Students will learn how to handle file uploads using IFormFile, apply upload limits and validation, and serve uploaded content securely. The lab allows learners to add brochure upload functionality to product records, reading paths and settings from the configuration file. This lesson also ties together concepts such as feature toggling and runtime config binding to conclude the course.

Estimated Duration: 1 h 30 m

Hands-On Exercises

Exercise 1: Project Setup and Basic File Upload Configuration
Set up a new ASP.NET Core Razor Pages project connected to the TailspinToys2020-US database and configure the foundation for secure file upload functionality. This exercise establishes the groundwork for implementing file uploads with proper validation and security measures.
Estimated Time: 30 minutes
Exercise 2: File Upload Interface and Workflow Implementation
Create a comprehensive file upload interface with drag-and-drop functionality, progress tracking, validation feedback, and complete workflow implementation. This exercise demonstrates modern file upload UX patterns and secure server-side processing.
Estimated Time: 20 minutes
Exercise 3: Advanced File Upload Features and Bulk Operations
Implement advanced file upload capabilities including multiple file uploads, enhanced content validation, bulk operations for product management, and comprehensive file management features. This exercise demonstrates enterprise-level file handling capabilities.
Estimated Time: 30 minutes
Exercise 4: Security Enhancements, Monitoring, and Course Wrap-Up
Implement enterprise-level security enhancements, monitoring capabilities, and create a comprehensive course capstone project that demonstrates all concepts learned throughout the course. This exercise showcases production-ready file upload systems with security, monitoring, and administrative features.
Estimated Time: 30 minutes