【问题标题】:Commandfield image not displaying命令字段图像未显示
【发布时间】:2013-11-06 18:38:33
【问题描述】:

在我的网格视图中,我有一个带有编辑和更新的命令字段。显示的是文本而不是图像。我做错了什么?

    <asp:GridView ID="gvFleetSheet" runat="server" AutoGenerateColumns="False" 
    AllowPaging="True"  PageSize="7" Width="1959px" BorderColor="Black" BorderStyle="Solid"  
    CellPadding="3" BorderWidth="2px">
 <Columns>
 <asp:CommandField ShowEditButton="true" InsertImageUrl="\\sos-sp\websites\SAB_Requests\Images\ico_edit.bmp" UpdateImageUrl="\\sos-sp\websites\SAB_Requests\Images\submit.png" /> 
  //other template fields....
 </Columns>
 <HeaderStyle BackColor="#FFFFCC"  BorderColor="Black" BorderStyle="Solid" 
             BorderWidth="2px" />
</asp:GridView>

【问题讨论】:

  • 查看源代码并查看是否有图片标签,可能图片下载失败...(返回404)
  • 当我输入图像地址时,它在我这边工作正常,图标显示(我们在我们的服务器上有权限).....

标签: asp.net gridview commandfield


【解决方案1】:

图片网址错误,应该是:

    InsertImageUrl="~/sos-sp/websites/SAB_Requests/Images/ico_edit.bmp"

【讨论】:

    猜你喜欢
    • 2015-11-16
    • 1970-01-01
    • 1970-01-01
    • 2023-04-03
    • 2014-03-23
    • 2013-07-24
    • 1970-01-01
    • 2013-04-25
    • 1970-01-01
    相关资源
    最近更新 更多