Reputation: 13875
Is there anyway I can change this inline razor conditional statement so that the class attribute isn't always output to the html unless the class is actually being added. I don't want my html to have class="" in it.
<div id="wrapper" class="@(isMobile ? "mobileView" : "")">
Upvotes: 0
Views: 2092
Reputation: 6520
What about
<div id="wrapper" @(isMobile ? "class=\"mobileView\"" : "")>
Upvotes: 2