In this article you’ll learn how to Create ASP.NET Core Razor Pages. Below videos will cover all fundamentals of Asp.net core. We’ll explain you all by using one example below. Let’s check out now.
What you’ll learn below:
We’ll Create a Razor Pages web app using ASP.NET Core
This series of video tutorials explains you about the basics of building a Razor Pages web app. In this tutorial we’ll give you details of all folder structure, use of GET and POST of data in the application.
ASP.NET Core Razor Pages-Installation:
For the installation of asp.net Core with Visual Studio, you can refer our video HERE.
What are Razor Pages?
It is page-focused framework with clean separation of concerns. Razor pages allow you to create cross-platform, data-driven, server-side web pages. It is very easy to learn, one who is switching from Asp.net WEB FORM can also work on this without any additional knowledge of Controllers/ Views.
Advantages of Razor Pages:
- It is very easy to learn.
- It uses Razor markup and C# language for development. It is also very Lightweight and flexible to use.
- It has code behind page like asp.net web forms, so no dependency of controllers and view etc.
- It supports cross-platform and can be run on Windows, UNIX, and Mac operating systems.
Code Sample:
Its HTML code will appear like this which will start with @page Directive and it must be the first directive on the page.
@page
<h1>Hello, Let's Learn on Codeconfig.in </h1>
<h2>The time on our server is @DateTime.Now</h2>
Introduction to Asp.net Core:
Creating new project using Asp.net Core:
Explaining files and folder structure in asp.net core:
Use of OnGet Method and in build dependency Injection in asp.net core:
Use of OnPost Method and save data to DB table using Asp.net core:
This is the first article of Asp.net core series. Hope you enjoyed this article and learn something from it.
You can learn more on C# using our C# Section. For Asp.net core you can refer Microsoft learn.