2012-08-05 47 views
1

如何將此webgrid中的動作鏈接更改爲圖像? PS:我想所有的圖像出現在同一列在webgrid鏈接中使用圖像

@{ 
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"))); 


        } 
+0

可能[更改動作鏈接到圖像]的副本(http://stackoverflow.com/questions/11738893/changing-an-action-link-to-an-image) – rene 2012-08-06 15:52:56

回答

1

一種方法是添加CSS的hyplerlink有這樣

例的背景圖像:

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

我解決了它。無論如何,謝謝:) – Kira 2012-08-05 14:12:23

+0

@HediNaily如果它是正確的,你已經標記了這個答案。 – 2013-04-27 01:18:53