【发布时间】:2013-09-24 09:54:11
【问题描述】:
我想将我的数据绑定到列表框中,就像 mvc 中的网格视图一样
@model IEnumerable<ProjectModel>
@{
var grid = new WebGrid(
source: Model,
rowsPerPage: 4);
}
@grid.GetHtml(
tableStyle: "grid",
headerStyle: "header",
rowStyle: "row",
footerStyle: "footer",
alternatingRowStyle: "altRow",
columns: grid.Columns (
grid.Column("projectName"),
grid.Column("ProjectID")
))
就像我们在这个视图中所做的那样。
【问题讨论】:
标签: asp.net asp.net-mvc-3 gridview razor