我有我想要顯示的圖像而不是文字網頁格「刪除」MVC 3網格圖像
,而不是這個「Html.ActionLink(」刪除「」我希望把圖像
我怎麼能做到這一點
這是我的代碼:?
enter code here
@{ var grid = new WebGrid(source: Model.PartImageSearchResult, rowsPerPage: 2, canPage: true, defaultSort:
"PartImageSearchResult.PartImageName", canSort: true, ajaxUpdateContainerId: "ImagesListGrid");}
@grid.GetHtml(
mode: WebGridPagerModes.All,
numericLinksCount: 5,
firstText: "First",
lastText: "Last",
previousText: "Previous",
nextText: "Next",
tableStyle: "webgrid",
headerStyle: "webgrid-header",
rowStyle: "webgrid-row-style",
footerStyle: "webgrid-footer",
alternatingRowStyle: "webgrid-selected-row",
htmlAttributes: new { id = "PartFilesUploadID" },
columns: grid.Columns(
//grid.Column(style: "PartImagesDelete", format: (item) => Html.ImageLink("~/Content/images/btn_delete_sm.png", "DeletePartImages", new { id = item.PartFilesUploadID }, new { onclick = "return confirm('Are you sure you wish to delete this article?');" })),
grid.Column(style: "PartImagesDelete", format: (item) => Html.ActionLink("Delete", "DeletePartImages", new { id = item.PartFilesUploadID }, new { onclick = "return confirm('Are you sure you wish to delete this article?');" })),
grid.Column(header: "Images", style: "PartImages", format: @<text><img src="@Url.Content("~/Uploads/Parts/" + item.PartImageName)" alt="" style="width:100px;height:50px;" /></text>),
grid.Column(header: "Files Name", format: @<text>@((item.PartImageName as String))</text>)))
尼克謝謝你回答我的問題。 – user1361209 2012-04-27 15:07:12
我想做這樣的事情: – user1361209 2012-04-27 15:07:26
grid.Column(style:「PartImagesDelete」,format:(item)=> Html.Action(「〜/ Content/images/btn_delete_sm.png」,「DeletePartImages」,new {ImageID = item.PartFilesUploadID},new {onclick =「return confirm('您確定要刪除這篇文章?');」})), – user1361209 2012-04-27 15:07:33