This question already has an answer here:
- How to use ternary operator in razor (specifically on HTML attributes)? 6 answers
Not having much luck, I have the following if/else statement in Razor which works perfectly
<small>
@if(deletedView){
@:Deleted
}
else {
@:Created
} by
</small>
I am trying to do something like this:
<small>
@(deletedView) ? @:Deleted : @:Created by
</small>
But that fails miserably. What is the proper syntax?