这是我的网络网格:
{
var grid = new WebGrid(Model, rowsPerPage: 15, ajaxUpdateContainerId: "PListGrid");
@grid.GetHtml(
tableStyle: "webgrid",
headerStyle: "webgrid-header-a",
footerStyle: "webgrid-footer",
alternatingRowStyle: "webgrid-alternating-row",
selectedRowStyle: "webgrid-selected-row",
rowStyle: "webgrid-row-style",
columns:
grid.Columns(
grid.Column("ITEMNMBR", "Part #", canSort: true,
format: (item) => Html.ActionLink(((string)item.ITEMNMBR),
"PCreate", "PartsLabor", new { ITEMNMBR = @item.ITEMNMBR }, null)),
grid.Column("ITEMDESC", "Part Description", canSort: true)
))
}
当视图加载时,您将鼠标悬停在 ITEMNMBR/Part # 列的链接上,您会看到类似于以下内容的内容:
domain.com/PartsLabor/PCreate?ITEMNMBR=ABCDEFG
我还有一个 viewbag 项目 (CALLNBR)。 如何让操作链接解析为:
domain.com/PartsLabor/PCreate?ITEMNMBR=ABCDEFG&CALLNBR=123456
换句话说,如何将多个参数传递给 Html.ActionLink?