I am trying to use the following code.
<td>@(piece.Publisher == null ? (MarkupString)"<span class='badge bg-danger'>No</span>" : piece.Publisher.Name)</td>
It's not producing what I'm intending. It's literally printing 'No' in the TD.
How can I get it to render the span as HTML?
--UPDATE-- It's odd, I've tried both suggestions and breaking it out in to fill IF statements seems to be the most reliable, but here is an instance where it works fine.
<p>Score?: @(piece.ScoreYesNo ? (MarkupString)"<span class='badge bg-success'>Yes</span>" : (MarkupString)"<span class='badge bg-danger'>No</span>")</p>
Now if I do the same thing with Publisher, it renders the markup as a string.
<p>Publisher: @(piece.Publisher == null ? ((MarkupString)"<span class='badge bg-danger'>No</span>") : piece.Publisher.Name)</p>
Notice that the one that works has MarkupString in both the true and false, It's strange. Anyone understand why it's not working?
Thanks!