Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# asp.net.mvc中@*运算符的含义是什么?_C#_Html_Asp.net Mvc_Razor_Comments - Fatal编程技术网

C# asp.net.mvc中@*运算符的含义是什么?

C# asp.net.mvc中@*运算符的含义是什么?,c#,html,asp.net-mvc,razor,comments,C#,Html,Asp.net Mvc,Razor,Comments,我是ASP.NETMVC剃须刀引擎的新手 我想知道在cshtml代码中的html片段之前使用@*的意义/目的?这是一个注释 @* this is commented code in a .cshtml file*@ 与.cs文件中的类似 /*this is commented code in a .cs file*/ 它标志着一个新时代的开始。它用相应的*@符号关闭 asp.net.mvc中@*运算符的含义是什么 它与ASP>NETMVC无关。它特定于Razor视图引擎。它用于注释输出中跳过

我是ASP.NETMVC剃须刀引擎的新手

我想知道在cshtml代码中的html片段之前使用
@*
的意义/目的?

这是一个注释

@* this is commented code in a .cshtml file*@
与.cs文件中的类似

/*this is commented code in a .cs file*/
它标志着一个新时代的开始。它用相应的*@符号关闭

asp.net.mvc中@*运算符的含义是什么

它与ASP>NETMVC无关。它特定于Razor视图引擎。它用于注释输出中跳过的代码或标记的特定部分

所以如果你这样做了

@* Some Tags or Code *@

它只是服务器端的一个注释。此外,此语法表示Razor解析器应该忽略该块中的所有内容,并将其视为根本不存在(这意味着不会执行任何操作,运行时不会产生性能开销,也不会向客户端发送任何内容)。

这用于注释代码

@* Your code here to comment *@
visual studio键盘快捷键:
选择要注释的部分,然后按:CTRL+K+C将注释代码。
和CTRL+K+U将取消注释代码



对于正在查找
.aspx查看引擎
页面的用户

<%-- Your code here to comment --%>


那么,是否有其他可能将Razor view引擎与一起使用?razor视图引擎不是VB和C的ASP.NET-view-engine吗?@MatthiasBurger razor也可以像T4模板一样使用。它只是MVC中的默认视图引擎。每个视图引擎都有不同的注释样式。e、 g.FormsViewEngine有
。啊,好吧-我不知道。谢谢+1你当然认为他在使用视觉工具Studio@AshleyMedway当然可以。我对我的答案做了一点修改。