
Learn to build a highly scalable blog application with ASP.NET Core Razor Pages, using Entity Framework and SQL Server, with authentication, authorization, and admin role management.
Set up your development environment with the required software and packages to run the ASP.NET Core Razor Pages course smoothly.
Download and install dotnet eight, selecting the SDK and runtime from the official dotnet download page for Windows 64-bit, with options for Linux and macOS.
Download and install Visual Studio 2022 to code .NET solutions. On Windows, choose the community edition and add ASP.NET and web development, .NET desktop development, and data storage components.
Download and install SQL Server 2019 Developer Edition and SQL Server Management Studio, connect to a local server instance, and prepare to create a database and a Web API.
Follow the full video to avoid missing key information and errors, revisiting sections as needed. Develop debugging skills by researching online and using sites like Stack Overflow to find solutions.
Explore the complete source code for the ASP.NET Core Razor Pages app in the GitHub repository, clone with git clone, and review commits and diffs to understand the code reasoning.
Explore dotnet core, the latest .NET release, and its benefits. Harness a free, open-source cross-platform framework for mobile, web, cloud, with strong performance and a built-in dependency injection container.
Explore Razor Pages as a lightweight, server-side framework in ASP.NET Core for building dynamic, data-driven websites with clean separation of concerns and cross-platform deployment.
Create a new ASP.NET Core Razor Pages web application from scratch using Visual Studio, selecting the ASP.NET Core Web Application template with .NET 8 for the bloggy.web project.
Explore the ASP.NET Core project structure, including solution, project, launch settings, www root folder, pages and shared folders, partial views and layout; learn dependency injection and the request pipeline.
Create domain models for a blog app, defining blog post and tag entities with their properties and relations, then use entity framework core migrations to create a SQL Server database.
install entity framework core packages in asp.net core razor pages project using manage nuget packages: microsoft dot entity framework core dot sql server and microsoft dot entity framework core tools.
Create a db context class that bridges domain models and the database, enabling create, read, update, and delete operations for blog posts and tags with entity framework core.
Add a SQL Server connection string in appsettings.json as bloggy db connection string, using your local server name and a chosen database; Entity Framework will create the database with trusted_connection=true.
Inject the BlogDbContext into the app's service container using dependency injection, configure it with SQL Server and a connection string from appsettings.json, enabling data access via the DbContext.
Learn to create a database with entity framework core migrations, using add-migration and update-database to generate and apply initial migration that creates blog posts and tags tables in SQL Server.
Create Razor Pages and perform create, read, update, delete operations on a blog post table using Entity Framework, building on earlier database groundwork to bring the application to life.
Apply Bootstrap styles to darken the navbar and background, adjust header and footer, and set up a first Razor page for a blog post.
Create a new Razor page under admin/blogs for adding blog posts, wire it to a code-behind class, and enable navigation from the admin dropdown to the page at /admin/blogs/ad.
Create a blog post Razor form with BindProperty, using Bootstrap for inputs like heading, page title, content, publish date, and then submit data to the backend.
Explore form submission in razor pages, comparing request.form reading with property binding. Learn to bind inputs to a view model and read values in on post for entity framework submission.
Learn to submit a blog post form in asp.net core razor pages, map it to a blog post domain model, and persist it via entity framework and the db context.
Load blog posts from the database with constructor injection of the blog db context and display them in a bootstrap table on the list page.
Edit blog posts by moving from the list to a razor edit page, fetch and bind the post with EF Core, update fields, save changes, and return to the list.
Implement delete functionality on the edit blog post page with a delete button and a page handler, removing the post via the blog DB context and redirecting to blog list.
Learn to convert razor pages methods to asynchronous tasks using async and await, and apply entity framework core asynchronous calls like add async, find async, and save changes async.
Explore the repository pattern as a middleman between domain and data access, and implement a blog post repository with interface, CRUD methods, and dependency injection in ASP.NET Core Razor Pages.
Learn how to inject a blog post repository via dependency injection, replacing direct db context usage with a repository pattern to perform add, get, update, delete, and get all operations.
Show success notifications in an ASP.NET Core Razor Pages app by using ViewData to pass a message from page model to the edit page and display a Bootstrap alert.
Pass notifications between Razor Pages using temp data to show feedback after a form submission. Read the temp data on the list page and render a dismissible alert.
Make notifications generic by using a notification view model with a type and message, and render them via a shared partial on Razor pages.
Add a visual editor and image upload to the ad block and edit pages to create blog content, then build an API to store images with Cloudera's hosting SDK.
Integrate a wysiwyg editor into the add and edit blog pages in a Razor Pages app, enabling rich html content creation via the editor and saving content to the database.
Create a rest api and repository for image uploads to a cloud hosting provider, then call it from web pages with JavaScript to attach wysiwyg and featured images.
Create an images API controller in a Razor Pages app, mark it as an API controller, and configure routing to api/images to support get and post methods for image upload.
Create a post method to upload images and build an image repository for cloud energy, enabling file uploads and returning the image URL.
Register to cloud energy, sign up for free, and configure the .NET SDK to upload images via the programmable media API using API key, secret, and cloud name.
Wire the image repository to its cloud energy implementation in asp.net core razor pages, test the upload via the controller, and return the image url or an error via postman.
Learn to call the image api from razor pages by adding a featured image upload on the blog admin page, bind an IFormFile, and post via fetch to /api/images.
Add image upload to the Froala editor in an ASP.NET Core Razor Pages blog, wiring content and featured images to a cloud provider via the API/images endpoint.
Save blog posts to the database, display all blogs to users, route to individual blog details, and add tags or categories to posts.
Seed real-world blogs into your ASP.NET Core Razor Pages app with the provided SQL script, delete existing posts, and display the new blog posts on the site's main page.
Create a hero section and display blog blocks on the home page using Razor Pages and Bootstrap, fetching blogs via a repository and rendering featured images, titles, authors, and summaries.
Display blog details on a dedicated page by routing to the URL handle, fetch from the database, and render the title, author, date, image, and HTML content for SEO.
Add tags to blog posts and use them to navigate and surface related posts. Create a navigation property in Entity Framework Core and display database tags in the web app.
Create a navigation property on the blog post domain model to relate it to tags, establishing a one-to-many relation, then run an EF Core migration and update the database.
Learn to add comma-separated tags to a blog post using Razor Pages, bind a tags input to a tag list, split by comma, and persist tag relationships in the database.
Add and display comma-separated blog post tags in the edit page, bind and populate tags from the database, and implement update logic that deletes old tags and adds new ones.
Create a tag repository and fetch all distinct, lowercase tags from the database, then inject it into the home page and render them as bootstrap badges under the blog heading.
Display blog tags on the blog details page by retrieving tag information from the blog's navigation property and rendering badges, enabling navigation to all blogs with each tag.
Implement tag based routing in ASP.NET Core Razor Pages to /tags/{tagName}, display blogs by tag, and convert spaces in tags for clean URLs and navigation.
Explore authentication and authorization with Microsoft Identity, build register and login pages, define roles user, admin, and super admin, and seed initial roles with Entity Framework Core.
Install the Microsoft.AspNetCore.Identity.EntityFramework NuGet package, create an identity DbContext, and seed roles including super admin, admin, and user, along with a super admin user to enable authentication and authorization.
Add a bloggy auth db connection string in appsettings.json. Inject the db context and configure identity to use the db context with entity framework stores and enable authentication before authorization.
Fix the role assignment for the super admin, admin, and user, then run EF Core migrations for authentication by adding a migration and updating the database with the -context specification.
Create a register page in ASP.NET Core Razor Pages, with a form for username, email, and password, binding to a register view model and posting to identity user creation.
Specify the DbContext type in the options for both block DbContext and odd DbContext to fix the error and get the application running.
Test the register page by submitting valid and invalid passwords and observing the on post flow. Configure identity options to enforce password rules and add bootstrap-styled login and register navigation.
Create a login page in asp.net core razor pages with a username and password view model, authenticate via sign in manager, and update layout to show logout and username.
Implement a logout page and functionality using the identity sign in manager, perform async sign out, and redirect to the home page, while updating the layout to show the username.
Seed the super admin with normalized username and email in the auth db context, add a migration named adding normalized user name, and update the database to enable login.
Assign the user role during registration by using the user manager to add the 'user' role, enabling authorization and role-based page restrictions.
Implement role-based authorization to protect admin pages, requiring authentication and admin or super admin roles, then customize the login redirect path to enforce secure access.
Implement role based authorization to admin pages using the authorize attribute with admin roles, differentiate super admin and admin, and show an access denied page and nav adjustments for non-admin users.
Redirect users to the originally requested admin page after login by checking a return URL, ensuring they reach the blog list or post page instead of the home page.
Add like and multi-comment functionality for logged-in users by introducing two new domain models and migrating them with Entity Framework Core to establish a one-to-many relation with blog posts.
Define the blog post like model with id, blogPostId, and userId, and add a likes collection. Create a migration adding blog post likes table and update the blog db context.
Implement total likes on blog details in ASP.NET Core Razor Pages using Bootstrap icons and a repository with EF Core, displaying the like count on the details page.
Implement a like feature by wiring a client click to an api that saves the like using a blog post like request and the user id from identity.
Enforce a single like per user, refresh total likes in real time, and hide the like button for non-logged-in users by updating the Razor Pages, controller endpoints, and repository logic.
Add a domain model for blog post comments, link it to blog posts, include user ID and date added, expose comments as a collection, and scaffold migration to update database.
Implement a bootstrap-styled comment section on the blog details page with a post form for signed-in users, saving comments via a repository and redirecting back to the details page.
Display comments for a blog post by fetching all comments from the repository, enriching them with usernames via the user manager, and rendering them on the Razor Pages detail view.
Develop admin user management in ASP.NET Core Razor Pages, enabling admins to create, read, update, and delete normal users and admins, via a user page with a popup add flow.
Build an admin Razor page to display all users by implementing a user repository, fetching IdentityUser data, mapping to a view model, and excluding the super admin from the results.
Create a bootstrap modal form to add a user (username, email, password), bind it to a Razor Pages model, and save with roles via a repository and user manager.
Add delete buttons next to each user, capture the user id with data-id, post to delete, and remove the user via the repository under admin access.
Protect your application's data by validating form submissions before storing them in the database. Implement validations to ensure only clean, acceptable data passes through, with further validation methods covered later.
Explore client side and server side validations for reserve forms in ASP.NET Core Razor Pages, showing how browser checks are fast but insecure, while server side validations ensure data safety.
Implement server side validations on the register page with data annotations for username, email, and password; enforce required fields, email format, and minimum password length.
Add client side validations to the register page with HTML5 required attributes for username, email, and password, plus a six-character minimum, while preserving server side validations.
Validate the login page with server-side and client-side checks using data annotations (required, min length) and model state, displaying validation messages and handling a possibly null return URL.
Validate the add user form with server side and client side validation. Use data annotations for required username, email, and password; enforce email format and password length; show validation messages.
Implement server-side and client-side validations for the add blog post page, using data annotations, model state, and a custom business rule for the published date.
This lecture covers adding server-side validations to the edit blog post page by using a view model, mapping from domain models, and applying data annotations plus client-side checks.
Add server-side validations for blog comments with required, min-length, and max-length data annotations and ensure the blog post details page displays validation messages and handles not found posts.
A Real-World .NET8 Web Application Using ASP.NET Razor Pages and Entity Framework and SQL Server database. This is a complete comprehensive course that uses the Razor Pages Framework to Build an ASP.NET Core Web Application written in C#.
This is a complete guide to Learning and Building scalable and data-driven websites using C# programming, ASP.NET, ASP.NET Core, and Razor Pages Framework.
If you have crossed paths with ASP.NET MVC or intend to learn ASP.NET MVC in 2024, then it's high time you invest your energy in ASP.NET Core Razor Pages instead. As Microsoft says, ASP.NET Core Razor Pages is the preferred approach to creating ASP.NET Web Applications.
If you have web development experience working with ASP.NET Framework or ASP.NET Core, then this course will provide you with the amazing knowledge you need to build page-centric data-driven websites using the popular ASPNET Razor Pages Framework.
This course is for all skill levels and is best suited for beginners and intermediate developers who have gained knowledge in C# and ASP.NET framework and want to use their skills to learn highly scalable websites using ASP.NET Razor Pages.
In this course, we will make use of ASP.NET Core i.e. .NET8 Razor Pages to build a complete blog application with multi-role user support (user and admin support).
During this course, you will gain so much experience with web pages and web components, I am confident that you will gain enough practical knowledge to create your own ASP.NET Core Razor Pages Web Applications.
If you want to create functional, generic, clean, and usable websites using ASP.NET, then this is the course for you.
In this course, you will learn and implement:
Learn And Create Your First ASP.NET Razor Pages Application
Create a fully functional, highly scalable, page-centric blog application
Repository Pattern in ASP.NET Core
Understand why is Razor Pages the preferred approach to build ASP.NET Core Web applications and how Razor Pages are much simpler and more intuitive than their old counterpart i.e. the ASP.NET MVC framework.
If you come from an ASP.NET MVC background, then this will be a good step forward in learning the latest Web technology that Microsoft gives us to build websites and that is ASP.NET Razor Pages.
Understand and learn the concepts of .NET8 and apply them using the ASPNET Razor Pages Framework
Domain Modelling
Entity Framework Code First Approach
SQL Server
Seeding the Database
CRUD operations using ASP.NET Razor Pages
Showing Notifications (ViewData, TempData, etc)
Routing in Razor Pages
Domain Models vs View Models
Authentication and Authorization
Multi-Role Authorization
Full User and Admin Support in the Blog Application
Rich Text Editor
Uploading Images To A 3rd Party Image Hosting Provider
Creating APIs within our Razor Pages Application and Call Them using Javascript
Server-Side and Client-Side Validations.
Create, Read, Update, and Delete using Entity Framework Core and SQL Server
Web Development Using Razor Pages in ASP.NET Core
Write Clean, Re-Usable Code