开发者

Literals that precede { in spark view engine

开发者 https://www.devze.com 2022-12-26 14:36 出处:网络
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.

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 {


Also ?{ for conditional output.


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.


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)

0

精彩评论

暂无评论...
验证码 换一张
取 消