Razor is a markup syntax that allows you to embed server-based code (Visual Basic and C#) into web pages.
Server-based code creates dynamic web content as the web page is delivered to the browser. When a web page is requested, the server executes the server-based code in the page before returning the page to the browser. Run by the server, the code can perform complex tasks, such as accessing a database.
Razor is based on ASP.NET and is designed for creating web applications. It has the functionality of traditional ASP.NET, but is easier to use and easier to learn
Razor - C# loops and arrays syntax
If you need to execute the same statement repeatedly, you can set up a loop.
If you know the number of times you want to loop, you can use a for loop.
Razor - C# loops and arrays example
<html> <body> @for(var i = 10; i < 21; i++) {<p>Line @i</p>} </body> </html>