【发布时间】:2011-09-11 00:24:20
【问题描述】:
可能重复:
How to use ternary operator in razor (specifically on HTML attributes)?
我正在尝试执行以下操作,但它出错了,所以我显然在使用 Razor 语法时做错了:
<td>@{item.Licence.MachineId != null ? @:"TB Master" : @:"HandHeld"} </td>
【问题讨论】:
标签: asp.net-mvc asp.net-mvc-3 razor