Non avendo molta fortuna, ho il seguente if/else in Razor che funziona perfettamenteRazor Se sintassi/Else operatore condizionale
<small>
@if(deletedView){
@:Deleted
}
else {
@:Created
} by
</small>
che sto cercando di fare qualcosa di simile:
<small>
@(deletedView) ? @:Deleted : @:Created by
</small>
Ma questo fallisce miseramente. Qual è la sintassi corretta?
http://stackoverflow.com/questions/4091831/how-to-use-ternary-operator-in-razor-specifically-on-html-attributes –
l'uomo. grazie –
mmhh, non posso chiudere la mia domanda. –