ASP (a) what is razor

Source: Internet
Author: User

Razor is a markup syntax for adding server-based code to a Web page

Razor is not programming and language. It is a service-side markup language.

When a Web page is written to the browser, the server-based code can create dynamic content. When the Web page loads, the server executes the server-based code within the page before returning the page to the browser. Because it is running on a server, this code can perform complex tasks, such as accessing a database.

Razor is based on ASP. NET, which is designed for the creation of WEB applications.

Razor has the ability to have traditional ASP. NET tags, but it's easier to learn and easier to use

Razor is a server-side markup syntax similar to ASP and PHP

Razor support for C # and Visual Basic programming languages

Advantages:

#Razor syntax is simple and clear, requiring only minimal input

#Razor Easy to learn, syntax similar to C # and VB

#Visual Studio provides smart hints and syntax coloring for Razor

#Razor view does not need to allow programs or start a Web server to test

New features:

  • @model used to specify the model type to upload to the view
  • @* * comment syntax
  • For the entire site, you can set default items, such as layouts, at once.
  • The Html.raw method provides output that is not HTML -encoded
  • Support for sharing code between multiple views (_viewstart.cshtml or _viewstart.vbhtml)

The Razor also contains new HTML helpers, such as:

  • Chart. Generate chart
  • WebGrid, generating data tables to support full pagination and sorting
  • Crypto, use hash algorithm to create hash and salt-adding passwords
  • Webimage, creating pictures
  • WebMail, send e-mail

ASP (a) what is razor

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.