asp.net mvc 3 - Razor view engine, how to write inbetween html? -
i have problem razor syntax. know how write inbetween html.. see sample..
<ul> @foreach (var x in model) { <li> @x.subject - tags: @if (x.tags != null) { foreach (var t in x.tags) { @t.name } } else { no tags } </li> } </ul>
i should able write "no tags" doesnt work... no tags seem included in code (which not want.
thanks
you need explicitly tell razor you're writing html, writing @:no tags
or <text>no tags</text>
.
Comments
Post a Comment