Building Web Applications with ASP.NET Razor Pages
Master ASP.NET Razor Pages — from routing and forms through authentication, EF Core, AJAX, security, caching, and testing with hands-on labs in VS Code.
View badge details
About This Course
Course Curriculum
32 Lessons
Introduction to Razor Pages & Project Structure
Learn what Razor Pages are, how they differ from MVC, the Page Model pattern, and the anatomy of a Razor Pages project.
Introduction to Razor Pages - Lab Exercises
Create your first Razor Pages project, explore the project structure, and build your first pages.
Routing, Pages & Handlers
Master convention-based routing, @page directives, route parameters, handler methods, named handlers, and page navigation.
Routing & Handlers - Lab Exercises
Build multi-page navigation with route parameters, named handlers, and redirects.
Forms, Model Binding & POST-Redirect-GET
Learn HTML forms with Razor Pages, model binding with [BindProperty], anti-forgery tokens, and the PRG pattern.
Forms & Model Binding - Lab Exercises
Build product create, edit, and delete forms with model binding and TempData messages.
Validation (Client & Server Side)
Master data annotations, ModelState validation, inline error display, client-side jQuery validation, and custom validation.
Validation - Lab Exercises
Add validation to product forms, display errors, and implement custom cross-field validation.
Layouts, Partial Views & View Components
Learn _Layout.cshtml, @RenderBody, sections, _ViewImports, _ViewStart, partial views, and View Components for reusable UI.
Layouts & View Components - Lab Exercises
Create a site layout, product card partial, category sidebar view component, and breadcrumb navigation.
Data Access with EF Core & PostgreSQL
Integrate EF Core with Razor Pages — DbContext registration, entity models, migrations, and CRUD page patterns.
Data Access with EF Core - Lab Exercises
Connect to PostgreSQL, create entities, run migrations, and build full CRUD pages for products.
Tag Helpers & Razor Syntax
Master built-in tag helpers (asp-for, asp-items, asp-page, asp-route-*), select lists, environment tag helper, and custom tag helpers.
Tag Helpers & Razor Syntax - Lab Exercises
Convert raw HTML to tag helpers, build select dropdowns, and create a custom price-display tag helper.
Dependency Injection, Configuration & Middleware
Learn service registration, injecting into PageModels and views, appsettings.json, IConfiguration, and custom middleware.
DI, Configuration & Middleware - Lab Exercises
Extract services with DI, configure app settings, add request logging middleware, and custom error pages.
Authentication & Authorization
Implement cookie authentication, ASP.NET Identity, login/register flows, [Authorize], policies, and role-based access.
Authentication & Authorization - Lab Exercises
Set up Identity, build login/register pages, protect pages with [Authorize], implement role-based access.
Consuming External APIs
Use HttpClient and IHttpClientFactory to call REST APIs from Razor Pages, with typed clients, error handling, and retry policies.
Consuming External APIs - Lab Exercises
Build typed HTTP clients, display external API data in pages, handle errors gracefully, and add retry logic.
File Uploads & Static File Management
Handle file uploads with IFormFile, validate file size and type, store and serve files, and manage product images.
File Uploads & Static Files - Lab Exercises
Build product image upload, validate files, store to disk, display in gallery, and handle multiple uploads.
AJAX, JavaScript Interop & Partial Updates
Use Fetch API with Razor Page handlers, return JSON from handlers, anti-forgery with AJAX, and partial page updates.
AJAX & JavaScript Interop - Lab Exercises
Add live product search, add-to-cart without reload, infinite scroll, and real-time stock checking.
Filters, Security & Error Handling
Learn page filters, global exception handling, CSRF deep dive, XSS prevention, Content Security Policy, and custom error pages.
Filters & Security - Lab Exercises
Implement page filters, global error handling, security headers, and custom 404/500 error pages.
Caching & Performance
Master in-memory caching, response caching, output caching, EF Core query optimization, and static asset bundling.
Caching & Performance - Lab Exercises
Add memory caching to product pages, configure response caching, optimize database queries, and measure performance.
Testing Razor Pages
Unit test PageModels with mocked services, integration test with WebApplicationFactory, and test forms, validation, and auth flows.
Testing Razor Pages - Lab Exercises
Write unit tests for PageModels, mock services, build integration tests with WebApplicationFactory, and test auth flows.
Capstone Briefing: BrightShelf Product Catalog
Review all concepts and receive the capstone project brief — build BrightShelf's complete product catalog web application.
Capstone: BrightShelf Product Catalog
Build a complete product catalog web application with CRUD, auth, search, file uploads, AJAX, caching, and tests.