Here is my Webgrid:
{
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)
))
}
When the view loads, and you hover over a link for the ITEMNMBR/Part # column, you see something similar to:
domain.com/PartsLabor/PCreate?ITEMNMBR=ABCDEFG
I also have a viewbag item (CALLNBR). How do I get the actionlink to resolve to:
domain.com/PartsLabor/PCreate?ITEMNMBR=ABCDEFG&CALLNBR=123456
In other words, how do you pass multiple parameters to the Html.ActionLink?