WebGrid将所选行值选择为Controller [英] WebGrid Selected Row Values into Controller
本文介绍了WebGrid将所选行值选择为Controller的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要让WebGrid选择行值到Controller中。
这是我的webgrid
@ {
var g_style = new WebGrid(来源:Model,
rowsPerPage:10) ;
@ g_style.GetHtml(
tableStyle:gridTable,
headerStyle:gridHead,
footerStyle:gridFooter,
rowStyle:gridRow,
alternatingRowStyle:gridAltRow,
列:g_style.Columns(
g_style.Column(标题:UserName,格式:@item => item.UserName),
g_style .Column(标题:角色,格式:@item => Html.DropDownList(角色,(IEnumerable < SelectListItem > )ViewData [Role], - Select - })),
g_style.Column(标题:批准,格式:@item => Html.ActionLink(批准,批准,新{id = item.UserID}))
))
}
这里我需要将下拉选择值和动作链接值输入控制器...
请帮帮我....
提前致谢...
解决方案
< blockquote>请参阅 http://www.aspdotnet-中的示例pools.com/2014/09/bind-dropdownlist-in-mvc-webgrid-and.html [ ^ ] http://www.c-sharpcorner.com/UploadFile/2b481f/ include-dropdown-list-inside-webgrid-in-web-api / [ ^ ]
Hi,
I need to get WebGrid selected row values into Controller.
this is my webgrid
@{
var g_style = new WebGrid(source: Model,
rowsPerPage: 10);
@g_style.GetHtml(
tableStyle: "gridTable",
headerStyle: "gridHead",
footerStyle: "gridFooter",
rowStyle: "gridRow",
alternatingRowStyle: "gridAltRow",
columns: g_style.Columns(
g_style.Column(header: "UserName", format: @item => item.UserName),
g_style.Column(header: "Role", format: @item => Html.DropDownList("Role", (IEnumerable<SelectListItem>)ViewData["Role"], "--Select--" })),
g_style.Column(header: "Approve", format: @item => Html.ActionLink("Approve", "Approve", new { id = item.UserID }))
))
}
here i need to get the dropdown selected value and the action link value into the controller...
Please help me....
Thanks in advance...
解决方案
Refer the sample at http://www.aspdotnet-pools.com/2014/09/bind-dropdownlist-in-mvc-webgrid-and.html[^]
http://www.c-sharpcorner.com/UploadFile/2b481f/include-dropdown-list-inside-webgrid-in-web-api/[^]
这篇关于WebGrid将所选行值选择为Controller的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文