Key Concepts

Review core concepts you need to learn to master this subject

Razor Syntax

@page @model IndexModel <h2>Welcome</h2> <ul> @for (int i = 0; i < 3; i++) { <li>@i</li> } </ul>

Razor Syntax allows you to embed code (C#) into page views through the use of a few keywords (such as “@”), and then have the C# code be processed and converted at runtime to HTML. In other words, rather than coding static HTML syntax in the page view, a user can code in the view in C# and have the Razor engine convert the C# code into HTML at runtime, creating a dynamically generated HTML web page.

Razor Pages Syntax I
Lesson 1 of 2

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo