[Asp.net MVC] Asp.net MVC5 series -- Razor syntax, mvc5razor

Source: Internet
Author: User
Tags valid email address

[Asp.net MVC] Asp.net MVC5 series -- Razor syntax, mvc5razor

The Razor view engine is a new extended content in Asp.net MVC3 and is also its default view engine. There is also a Web Forms view engine. The previous article shows that the Razor view engine is used by default to create a view in Asp.net mvc5. And the real one. In the previous version, developers can choose whether to use the Razor or webfroms view engine.

Razor provides a simplified syntax for view representation, minimizing the syntax and extra characters. This effectively reduces the syntactic barriers and does not have any new syntax rules in the view markup language. Razor supports two file types:. cshtml and. vbhtml. The. cshtml server code uses the c # syntax, And the. vbhtml server code uses the vb.net syntax. The core conversion character of Razor syntax is the "at" symbol (@). This character is used to mark the Conversion characters of the Code. Code-converted characters marked. There are two basic types of conversions: Code expressions and code blocks. Find the value of the expression and write the value to the response. Code expression implicit code expression example: 1 @ {string strName = "wofly";} 2

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.