0

我有一个网络网格,我想显示一个图像而不是“删除”这个词

而不是这个 "Html.ActionLink("Delete"," 我想放一张图片

我该怎么做?

这是我的代码:

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>)))
4

2 回答 2

0

我会看这里Action Image MVC3 Razor

您的操作是否在网格中无关紧要。如有必要,您可以在采用您的特定模型的自定义操作链接周围包裹一个部分。

于 2012-04-27T14:56:24.880 回答
0
grid.Column("", header: "Acciones", style:"width: 5%", 
                                    format: @<text>
                                                <div class="btn-group">
                                                    <a class="btn btn-small" href='@Url.Action("Editar", "Ruta", new { id = item.RutaID })'><i class="icon-pencil"></i></a>
                                                    <a class="btn btn-small" href='@Url.Action("Detalle", "Ruta", new { id = item.RutaID })'><i class="icon-eye-open"></i></a>
                                                    <a class="btn btn-small" href='@Url.Action("Borrar", "Ruta", new { id = item.RutaID })'><i class="icon-trash"></i></a>                                                                            
                                                </div>
                                            </text>)
于 2015-04-05T03:45:54.340 回答