Share the ASP. Razor Introduction

Source: Internet
Author: User
Tags classic asp

ASP. Razor-Tags

Razor is not a programming language. It is the 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 Web page.

Server-based code can create dynamic Web content when a Web page is routed to a browser. When a Web page is requested, the server executes the server-based code in the page before returning the page to the browser. By running the server, the code can perform complex tasks, such as entering a database.

Razor is based on ASP, and is designed to create WEB applications. It features traditional ASP. NET, but is easier to use and easier to learn.

Razor syntax

Razor uses syntax similar to PHP and classic ASP.

Razor:

<ul> @for (int i = 0; i < ten; i++) {<li>@i</li>}</ul>

Php:

<ul><?php for ($i = 0; $i < $i + +) {echo ("<li> $i </li>");}?></ul>

Web Forms (classic ASP):

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

Razor Helper

The ASP. NET helper is a component that can be accessed through a few lines of simple Razor code.

You can use the Razor syntax to build your own helper, or use the built-in ASP.

Here is a brief description of some useful Razor helpers:

Web Grid (web grid)

Web graphics (Web graphic)

Google Analytics (Google Analytics)

Facebook Integration (Facebook integration)

Twitter integration (Twitter integration)

Sending email (send email)

Validation (verification)

Razor programming language

Razor supports C # (C Sharp) and VB (Visual Basic).

"Recommended"

1. ASP. NET free Video Tutorials

2. Share the ASP. NET Learning Notes (1)--webpages Razor

3. Share the ASP. NET Learning Notes (2)--webpages Introduction

4. Using the razor engine to generate a static page (ASP. NET MVC) instance

5. [ASP. NET MVC path]03-razor syntax

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.