I have a model being populated by my data layer and then I have a partial view which is rendering an instance of that model.
<li class="<%= td.Active ? "youarehere" : string.Empty %> <%= i == ViewData.Model.Count() - 1 ? "last" : string.Empty %>">
The problem is that class=""
is invalid XHTML and I will need more complex logic to output the class attribute. What would be the proper way to go about this using ASP.NET MVC. Should the logic live in the view or the model?
I'm just starting out with MVC and I guess I'm still struggling on where exactly to draw the lines as far as where I put logic and what is an acceptable amount of logic for each layer to contain.