Spark 视图引擎中 { 之前的文字
我正在浏览 spark view 引擎文档,发现代码中出现了很多文字,我对此找不到任何参考。例如
!
、 #
、 $
、 !$
、...
这些是做什么用的?这些组合意味着什么?它们什么时候开始使用?我是否遗漏了 {
之前或之后的任何文字
I was going through the spark view engine documentation and found a lot of literals showing up in code for which I couldn’t find any references. For e.g.
!
, #
, $
, !$
, ...
What are these for? What do the combinations mean? When do they come into use? Am I missing any more literals that precede or comes after {
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
还有
?{
用于条件输出。Also
?{
for conditional output.发现一:
如果您想确保表达式产生的任何 null 值和 NullReferenceException 根本不会产生任何输出,也可以使用语法
$!{expression}
。Found one:
The syntax
$!{expression}
can also be used if you want to ensure any null values and NullReferenceException that result from the expression will produce no output at all.因此缺少的:
#
:将其放在行的开头以在视图中插入内联 c# 代码(必须像任何 c# 语句一样以 ; 结束行${}:希望你知道这一点;)
!{}
:不进行 html 编码的内容输出(不安全输出)So the missing ones:
#
: put it at the beginning of a line to insert inline c# code in the view (you must end the line with ; like any c# statement${}
: hope you know that one ;)!{}
: output without html encode the content (unsafe output)