---------------------------------------------------------------------------------------------------------
Embed the server code in the HTML file:
<Div> <!--Single line Mark -@{var name = "Slark";} @{Response.Write ("single line:name is" + Name + "<BR/>");}<!--inline (inline) markers -Inline:today is: @DateTime. now.tostring ("Yyyy-mm-dd")<BR/>Inline:name is @name<BR/> <!--Multi-line (multi-line) markers -@{var age = 25; Response.Write ("Multi-line:age is" + Age + "<BR/>"); }</Div>
Embed HTML code in the server code:
- In razor tagged code, if there is a pair of HTML tags, then this tag and its contents will be treated as normal text output. such as <p>var name2 = "Slark";</p>
- If there is "@:" in the code in the razor tag, the following line of code is treated as plain text output. such as @:var Name3 = "Slark"; <br/>
- If there is a <text>...</text> tag in the code of the razor tag, its contents are treated as normal text output. such as <text> var name4 = "Slark"; <br/> var name5 = "Slark"; </text>
Source: http://www.cnblogs.com/slark/p/4161772.html
---------------------------------------------------------------------------------------------------------
MVC fragmented Knowledge Point records