1.多行代码时需要包含在大括号内{}和每句代码后都需要加分号;
@{;;}
2.单行代码时不需要分号结束
@
3.输出文本
@:
4.在一句中将一段C#代码包括起来,证明这一句完整的C#代码
@()
Razor解决路径问题:
Html.ActionLink("显示的名字","动作名","控制器名")解析成<a href='/控制器名/动作名'>显示的名字<a/>
Html.BeginForm("动作名","控制器名")解析成<form action='/控制器名/动作名'></form>
Url.Action("动作名", "控制器名")