Possible Duplicate:
How to use ternary operator in razor (specifically on HTML attributes)?
I am trying to do the following but its erroring so I'm obviously doing something wrong with the Razor syntax:
<td>@{item.Licence.MachineId != null ? @:"TB Master" : @:"HandHeld"} </td>
The following should work:
<td>@(item.Licence.MachineId != null ? "TB Master" : "HandHeld")</td>
Try this
<td>@(item.Licence.MachineId != null ? "TB Master" : "HandHeld")</td>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With