ASP.NET Razor - sign

Razor Not a programming language . It is a server-side markup language .

What is? Razor?

Razor Is a markup syntax , Allows you to convert server based code (Visual Basic and C#) Embed in web pages .

Server based code can be transmitted to the browser when the web page , Create dynamic Web content . When a web page is requested , The server executes the server based code in the page before returning the page to the browser . Through the operation of the server , Code can perform complex tasks , For example, entering the database .

Razor Is based on ASP.NET of , Is created for Web Designed for applications . It has a tradition ASP.NET Function of , But easier to use and easier to learn .

Razor Grammar

Razor Used with PHP And classic ASP Similar syntax .


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


for ($i = 0; $i < 10; $i++) {

Web Forms( classic ASP):

<% for (int i = 0; i < 10; i++) { %>
<li><% =i %></li>
<% } %>

Razor Helper

ASP.NET The helper is simple through a few lines Razor Code accessible components .

You can use Razor Syntax build your own helper , Or use built-in ASP.NET Helper .

Here are some useful Razor A short description of the helper :

  • Web Grid(Web Grid )
  • Web Graphics(Web graphical )
  • Google Analytics(Google analysis )
  • Facebook Integration(Facebook integrate )
  • Twitter Integration(Twitter integrate )
  • Sending Email( Send email )
  • Validation( verification )

Razor programing language

Razor support C# (C sharp) and VB (Visual Basic).