【发布时间】:2015-03-13 05:14:53
【问题描述】:
我正在尝试在 webgrid 中显示模型数据。我看到@grid 中有两行,但没有显示任何内容。即使@grid 中有数据,也无法弄清楚导致这种情况发生的原因。 我试图显示一列只是为了测试,但我也尝试使用@grid.GetHtml() 显示所有列,但 UI 中仍然没有显示任何内容。任何指针表示赞赏!
@model IEnumerable<MyProject.Domain.Entities.Tests>
@{
WebGrid grid = new WebGrid(Model);
}
<table>
<tr>
<td>
@if (Model.Count() > 0)
{
@grid.GetHtml(
columns:grid.Columns(
grid.Column(columnName:"Capacity",header:"Capacity")
))
}
else
{
<div>Please select slots and right click on context menu to view attributes.</div>
}
</td>
</tr>
</table>
【问题讨论】:
-
我用firebug做了一些调试,令人惊讶的是它显示了post请求中的值
。它没有显示在页面上Slot_Num 11 12
标签: model-view-controller webgrid