asp.net-mvc-3 – 列中的MVC3 WebGrid自定义文本
发布时间:2020-12-16 00:12:58 所属栏目:asp.Net 来源:网络整理
导读:我正在使用VB.NET中的MVC3开发一个Web应用程序. 我在使用以下操作链接在webgrid上设置列时遇到困难 编辑|细节|删除 @*@Html.ActionLink("Edit","Edit",New With {.id = currentItem.PrimaryKey}) |@Html.ActionLink("Details","Details",New With {.id = cur
我正在使用VB.NET中的MVC3开发一个Web应用程序.
我在使用以下操作链接在webgrid上设置列时遇到困难 编辑|细节|删除 @*@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})*@ 我试图使用下面的语法,但我得到一个错误,其中未声明项目. grid.Column(header:=“”,format:=(item)=> item.GetSelectLink(“Custom Text”)) 如何引用webgrid中的当前行或项目以使其工作? 任何帮助非常感谢. 问候 詹姆士 解决方法grid.Column( columnName:"PrimaryKey",header:"Actions",format: (item) => { var links = Html.ActionLink("Edit",new {id = item.PrimaryKey}) + " | " + Html.ActionLink("Details",new { id = item.PrimaryKey}) +" | "+ Html.ActionLink("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> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc – 如果是流媒体,则无法发布网站
- asp.net-core – 如何在MVC Visual Studio 2015中发布JSON数
- 拆分/模块化大型ASP.NET Web应用程序项目
- asp.net – 具有齐次参数数组的MVC路由
- kendo-ui – Kendo UI MVC将MultiSelect数据值发送到Action
- asp.net – 在项目之间共享aspx页面
- asp.net-mvc-4 – 具有外部数据和TypeScript的Ng网格:编译
- asp.net中的页面卸载事件
- asp.net – 找不到ID为“xxx”的UpdatePanel.如果它正在动态
- asp.net – File.Exists从网络共享返回false
推荐文章
站长推荐
- asp.net – 如何使ASP CheckBoxList标签与复选框
- asp.net-core – 带有JSONP的ASP.NET Core MVC
- System.Net.ServicePointManager.DefaultConnect
- asp.net core 使用 TestServer 来做集成测试
- ASP.NET MVC jquery自动填充值和文本字段
- asp.net – 什么时候以明文形式存储密码是个好主
- asp.net-mvc – Firefox在Ajax请求重定向期间不保
- database – 为什么Entity Framework类需要一个不
- 为什么Request.IsAjaxRequest()在ASP.NET MVC 3中
- 验证 – ASP.NET和EF Core – 对于由Scaffold-Db
热点阅读