使用ASP.NET MVC的默认视图引擎,您可以像这样声明服务器端注释:<%-- This is a comment --%> 这个注释只会在服务器端可见,不会发送到客户端。我如何使用Razor视图引擎实现相同的效果?
使用@*开始注释块,使用*@结束注释块。 与C#中的(/*和*/)类似。@* single line comment *@ 或者@* this is a comment this is another *@ 可以在Gu的博客上了解更多有关Razor注释的信息。