lundi 16 mars 2015

Is there a way to terminate MVC Razor @: line?

Consider this example:



<input type="checkbox" @if (flag) { @: checked } />


The problem is that the } /> is conceived by the Razor engine as part of the output string.


I've tried to use parenthesis but no luck.


Is there a way to terminate the @: operator in same line, or I'll have to split it to other line / use ternary operator?


Aucun commentaire:

Enregistrer un commentaire