请帮我从MVC 4 WebGrid的radiobutton字段中选择Selected Row ID?我没有提交表单,而是使用按钮指向同一视图的HTTpGet动作方法。
以下是视图:
var grid = new WebGrid(ViewBag.inCompletePipelines, canPage: true, rowsPerPage: 10,
selectionFieldName: "selectedRow", ajaxUpdateContainerId: "inCompletePipelines");
grid.Pager(WebGridPagerModes.NextPrevious);
<div id="gridinCompletePipelines" class="gridwidthLong">
@grid.GetHtml(tableStyle: "webGrid",
headerStyle: "header",
alternatingRowStyle: "alt",
selectedRowStyle: "select",
columns: grid.Columns(
grid.Column("Name", " Pipeline Name"),
grid.Column("Length", " Length"),
grid.Column("ModifiedDate", "Modified Date"),
grid.Column("ModifiedBy", "Modified By"),
grid.Column(
header: "Select",
format: @<text>@Html.RadioButtonFor(x => x.Id, (int)item.Id)</text>
)
))
@Html.ActionLink("New Pipeline", "pipelines_saved", "PipeLine", new { Id= grid.SelectedRowID ???????? }, new {@class = "roundedButton" })