在webgrid链接中使用图像

时间:2012-08-05 10:59:31

标签: asp.net asp.net-mvc asp.net-mvc-3 razor 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")));


                    }

1 个答案:

答案 0 :(得分:1)

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

示例:

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