Building a Website with ASP.NET Razor Pages

Have you ever wanted to be able to use code to help build your webpages? Maybe loop over a list and create a table or inject user data onto the page without javascript or anything else? ASP.NET’s Razor Pages make that possible by letting you add C# code directly into your HTML webpages.

In this video we’ll look at how I’m taking advantage of Razor Pages and ASP.NET Core to build the new World of Zero website and discuss some of the basic core features provided by Razor Pages including variables, loops and inline statements. This syntax is a powerful tool when you don’t want to add the overhead of Angular or React to your website but still want to be able to create dynamic content.

Microsoft has a fantastic introduction to Razor Pages on MSDN. I highly recommend reading it to learn more about the syntax and what’s possible: https://docs.microsoft.com/en-us/aspnet/core/mvc/razor-pages/?tabs=visual-studio

Discord: https://discord.gg/hU5Kq2u

Comments

Lesedi Motaung says:

Awesome video. Do you have a clue and how to remove the container on the body of the website. When you add content on the index.cshtml it leaves spaces on the sides, but the Header and footer stuff in _Layout.cshtml is full screen. id like the body to be fullscreen aswell. I hope my question is clear enough.

Vitalie Hanganu says:

I do not think Razor with C Sharp is simply as Django framework with Python as backend? What do you think?

Yabba Dabba says:

There’s no E in RAZOR. Just sayin.

Matt Gipson says:

This will be really helpful for my portfolio site. Thanks!

World of Zero says:

If anyone is curious about the styling it’s a slightly customized version of Materialize: http://materializecss.com

D. A. says:

I wonder about your choice to have a “section” class instead of styling the html

tag ?

 Write a comment

*

Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!