Literals that precede { in spark view engine

最后都变了- 提交于 2019-12-11 07:30:38

问题


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 {


回答1:


Also ?{ for conditional output.




回答2:


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.




回答3:


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)



来源:https://stackoverflow.com/questions/2612411/literals-that-precede-in-spark-view-engine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!