我正在 VB.NET 中使用 MVC3 开发 Web 应用程序。
我无法使用以下操作链接在网络网格上设置列
编辑|详情 |删除
@*@Html.ActionLink("Edit", "Edit", New With {.id = currentItem.PrimaryKey}) |
@Html.ActionLink("Details", "Details", New With {.id = currentItem.PrimaryKey}) |
@Html.ActionLink("Delete", "Delete", New With {.id = currentItem.PrimaryKey})*@
我尝试使用下面的语法,但在未声明 item 的情况下出现错误。
grid.Column(标题:= "",格式:= (item) => item.GetSelectLink("自定义文本"))
如何引用网络网格中的当前行或项目才能实现此目的?
非常感谢任何帮助。
Regards
James
grid.Column(
columnName:"PrimaryKey",
header:"Actions",
format: (item) =>
{
var links = Html.ActionLink("Edit", "Edit", new {id = item.PrimaryKey}) + " | " +
Html.ActionLink("Details","Details", new { id = item.PrimaryKey}) +" | "+
Html.ActionLink("Delete","Delete", new { id = item.PrimaryKey});
return Html.Raw(links);
}),
呈现以下 HTML(为了易读而格式化)
<td>
<a href="/Home/Edit/5">Edit</a> |
<a href="/Home/Details/5">Details</a> |
<a href="/Home/Delete/5">Delete</a>
</td>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)