I’m creating a page based in Twitter bootstrap.
In a specific CUD, I need to change a class of a div. class="tab-pane active" or class="tab-pane" depending the property of my viewmodel.
The property probably is gonna be an int, and then for every div, I will make a verification on active tab. This sounds right?
I thought in something like:
<div(@Model.ActiveTab == 1 ? class="tab-pane active" : class="tab-pane") id="1">
but obviously this didn’t work
Try like this:
or to avoid this horrible tag soup write a custom HTML helper:
which could be used like that:
and which in this case would emit: