Can i shorten this to one line? I have tried various ways but can't quite get it right.
@if(SiteMap.CurrentNode.Title == "Contact")
{
@:<div class="contact">
}
Can i shorten this to one line? I have tried various ways but can't quite get it right.
@if(SiteMap.CurrentNode.Title == "Contact")
{
@:<div class="contact">
}
There might be an even simpler solution but this should work:
The shortest possible way to do is like:
or
or even shorter if you don't repeat your html code
Another way would be:
I personally find it more readable than the ternary operator, but this is personal