In my ASP.NET MVC view, I select a sprite based on the boolean value specified in the model as follows:
<div class="sprite-icon_dog<% =(Model.HasNewDog ? "_new" : "") %>"></div>
It's ugly, and I don't like it.
My goal is to use sprite-icon_dog_newif Model.HasNewDogis trueand use sprite-icon_dogif Model.HasNewDogis false.
What is more elegant and understandable for this?
source
share