Sunday 27 June 2021

ASP.NET Razor - What is it?

ASP.NET Razor is a (server-side) markup language, that allows you to embed server-based code into web pages (Visual Basic and C#).

Razor syntax is similar to PHP and Classic ASP.

The following Razor code outputs a series of list items.

<ul>

@for (int i=0; i<5; i++) {

<li>@i</li>

}

</ul>

The foreach loop is of course also supported in Razor.

No comments: