ASP. NET MVC Razor View Syntax
[email protected] symbol OUTPUT variable value
2. Use the C # syntax to nest HTML tags to loop output namelist values: Use @{c# syntax code}:
3. Output @ symbol using two @@
4. Server annotations Use @* comment content *@
[Email protected]: output text, or use <text></text>
6. Perform simple operations or operations at @ () brackets
[Email protected] () or @{} can output a string with HTML tags
8.Razor can be used to intelligently identify mailbox wording
9. Type Conversion
10. Embed (load) a sub-page (or other page) on the page
11. Layout (Master page)
@RenderBody (): This method loads the contents of a child page in the master page and then consolidates the rendering.
@RenderSection (name, whether the child page must be implemented)
[Email protected]
Create the App_Code folder under the root directory and write the @helper method to the xx.cshtml in this folder, and you can use it globally.
To use on other pages:
END
ASP. NET MVC Razor View syntax