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.

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.

ASP.NET Core Razor Pages

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Explore More

Must Read – Delegate in C#

In this post we will learn about “Delegate in C#”. A delegate is a person who represents an organization or group of people. In the C# world, a delegate is

11 Effective Debugging Tips for .NET Developer

As developers, we spend a lot of time debugging code, identifying the root cause of errors, and ultimately fixing it as part of our daily development activities. Some problems are

How to Hide Methods from debugger Using DebuggerHidden attribute

In this post we will learn “How to Hide Methods from debugger Using DebuggerHidden attribute“. The DubuggerHidden property tells the Visual Studio debugger that this method is hidden from and