Quintin Par
Quintin Par

Reputation: 16252

Literals that precede { in spark view engine

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 {

Upvotes: 1

Views: 189

Answers (3)

Guillaume86
Guillaume86

Reputation: 14400

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)

Upvotes: 0

Quintin Par
Quintin Par

Reputation: 16252

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.

Upvotes: 0

Roman
Roman

Reputation: 20256

Also ?{ for conditional output.

Upvotes: 1

Related Questions