I am fairly new to ASP MVC and was wondering what is the best way to handle conditional statements in your views? I am sure there isn't a one size fits all approach, but for simple checks is it wise to have If-Then-Else statements littering the view?
For example, say I have a list and wish to set the class on one of the list items if one of the model properties is set.
<% if (myModel.MyProperty == 1) { %>
<li class="myClass">
<% } else { %>
<li>
<% } %>
Is this the best way to approach this, or is there a better way? I am just concerned that if you have numerous conditionals like this in your view it is going to start to look pretty messy.
Thanks in advance for any advice.