在GridView中不显示图像

问题描述 投票:0回答:1

它显示数据库中的图像路径,但没有在gridview中显示图像

FileUpload2.SaveAs(Request.PhysicalApplicationPath + "./img/" + FileUpload2.FileName.ToString());
            b = "img/" + FileUpload2.FileName.ToString();

这个代码我写的图像

asp.net c#-4.0
1个回答
0
投票
<asp:Image id="Image2" runat="server" ImageUrl='<%# string.Format("~/{0}",Eval("ProductImage"))%>' height="150" width="150" />

试试这个代码。它对我有用

© www.soinside.com 2019 - 2024. All rights reserved.