【发布时间】:2019-04-04 00:01:20
【问题描述】:
我正在使用 GridMvc,例如:
@Html.Grid(Model.Customers).Columns(columns =>
{
columns.Add(x => x.FirstName).Titled(Translations.Global.FIRST_NAME).SetWidth(110).Sortable(true);
...
如何在此处使用 if 语句。我想创建 if 语句,例如:
if (x.LastName == 'Me')
{
<span class="label label-success">Active</span>
}
else
{
<span class="label label-important">Banned</span>
}
但我不知道如何在 gridmvc 中创建 if 语句。
【问题讨论】:
-
为什么不在 if 中添加一列?还是只是三级算子?
标签: c# asp.net-mvc-3