【问题标题】:using images in webgrid links在 webgrid 链接中使用图像
【发布时间】:2012-08-05 10:59:30
【问题描述】:

如何将此 webgrid 中的操作链接更改为图像? ps:我希望所有图片都出现在同一列中

@{
var grid = new WebGrid(Model, canPage:true ,canSort:true, rowsPerPage :6);
grid.Pager(WebGridPagerModes.NextPrevious);
    @grid.GetHtml(tableStyle: "webGrid", htmlAttributes: new { id = "datatable" },
    headerStyle: "Header",
    alternatingRowStyle: "alt",
    columns: grid.Columns(grid.Column(header: "", format: (item) =>
 new HtmlString(
       Html.ActionLink("Détails", "Details", new { id = item.id_client }).ToString() +
       Html.ActionLink("Modifier", "Edit", new { id = item.id_client }).ToString() +
                Html.ActionLink("Supprimer", "Delete", new { id = item.id_client }).ToString()
 ), style: "actions"),
    grid.Column("Nom"),
    grid.Column("Prenom", "Prénom"),
    grid.Column("Email")));


                    }

【问题讨论】:

标签: asp.net asp.net-mvc asp.net-mvc-3 razor webgrid


【解决方案1】:

一种方法是为超链接添加 css 以具有这样的背景图像

示例:

a.bgImg
{
    background: url(../Images/background.gif)
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-11-14
    • 2011-08-18
    • 2021-07-02
    • 1970-01-01
    • 2012-05-22
    • 2016-05-07
    • 1970-01-01
    • 2011-09-22
    相关资源
    最近更新 更多