【问题标题】:Image in GridView ASPGridView ASP 中的图像
【发布时间】:2019-12-15 13:04:52
【问题描述】:

我有一个网格视图,我想在一列中显示图像。我在数据库中存储了图像 URL。我希望 gridview 将 ImageField 与数据库中的 url 动态绑定。

【问题讨论】:

    标签: asp.net gridview


    【解决方案1】:

    试试这个。

    <asp:TemplateField HeaderText="Image">
      <ItemTemplate>
        <asp:Image ID="ProductImage" runat="server" ImageUrl='<%# Eval("ProductImagePath") %>'/>
      </ItemTemplate>
    </asp:TemplateField>
    

    或者这个

    <asp:ImageField HeaderText="Image" DataImageUrlField="ProductImagePath"/>
    

    【讨论】:

      猜你喜欢
      • 2011-07-28
      • 1970-01-01
      • 2011-06-19
      • 1970-01-01
      • 1970-01-01
      • 2023-04-01
      • 1970-01-01
      • 2013-03-29
      • 1970-01-01
      相关资源
      最近更新 更多