ASP. NET Razor-mark and asp. netrazor mark
Razor is not a programming language. It is a server-side markup language.
What is Razor?
Razor is a markup syntax that allows you to embed server-based code (Visual Basic and C #) into a webpage.
When a webpage is written into a browser, the server-based code can create dynamic content. When a webpage is loaded, the server executes the server-based code on the page before returning the page to the browser. Because it is running on the server, this code can execute complex tasks, such as accessing the database.
Razor is based on ASP. NET and designed for web application creation. It has the capabilities of traditional ASP. NET tags, but is easier to use and learn.
Razor syntax
The syntax used by Razor is similar to that used by PHP and ASP.
Razor:
<ul>@for (int i = 0; i < 10; i++) {<li>@i</li>}</ul>
PHP:
<ul><?php for ($i = 0; $i < 10; $i++) {echo("<li>$i</li>");} ?></ul>
Web Forms (and Classic ASP ):
<ul><% for (int i = 0; i < 10; i++) { %><li><% =i %></li><% } %></ul>
Razor helper
The Razor helper can be accessed through simple Razor code.
You can use the Razor syntax to build your own helper, or use the built-in ASP. NET helper.
The following is a brief description of some important Razor help tools:
- Web Grid
- Web Graphics
- Google Analytics
- Facebook Integration
- Twitter Integration
- Sending Email
- Validation
Razor Programming Language
Razor supports both C # (C sharp) and VB (Visual Basic ).