ASP. NET Razor-mark and asp. netrazor mark

Source: Internet
Author: User
Tags classic asp

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 ).


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.