0

如何在 MVC Webgrid 中保存图像?以及如何在 WebGrid 中生成图像列...?

<div id="grid" class="Radius">
    @grid.GetHtml(
                            tableStyle: "listing-border",
                            headerStyle: "gridhead",
                            footerStyle: "paging",
                            rowStyle: "td-dark",
                            alternatingRowStyle: "td-light",
                            mode: WebGridPagerModes.All,
                            firstText: "<<",
                            lastText: ">>",
                            previousText: "<",
                            nextText: ">",

        columns: grid.Columns(
        grid.Column(format: (item) => Html.CheckBox("check", false)),
        grid.Column("ID"),
        grid.Column("FirstName"),
                    grid.Column("LastName"),
                            grid.Column("EmailAddress"),
                            grid.Column("UserPicture"),
                            grid.Column("IsActive"),

                              grid.Column(header: "Edit", format: @<text><a href="@Url.Action("CreateUser", "User", new { ID = item.ID })" ><img src="~/Images/Edit.png" alt="" style="border:none;" /></a></text>, style: "colOperation"),
       grid.Column(header: "Delete", format: @<text><a href="@Url.Action("", "", new { ID = item.ID })" ><img src="~/Images/Delete.png" alt="" style="border:none;" /></a></text>, style: "colOperation")
)
                                     )
</div>
4

1 回答 1

0

试试这个在 webGrid 中创建 Image 列:

grid.Column(header,format: @<div><img src="@Url.Content("~/Content/images/icon_edit.png")" alt="@Resources.Tooltip_Update"/></div>))

在 webgrid 中保存图像是什么意思?

于 2012-12-04T06:42:51.140 回答