在datalist中的空图像图 [英] Null image figure in datalist
本文介绍了在datalist中的空图像图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
i有三个文件上传到数据库中存储路径图像。
i想要在数据库中插入三张图片中的两张(如下图) < br $> b $ b
http://8pic.ir/images/98875708231203613698.jpg [ ^ ]
在我的datalist 中没有显示空图像(如下图)
http://8pic.ir/images/84846050397371303282.jpg [ ^ ]
如果数据库中的图像文件路径为空,我只希望数据列表不显示任何内容...请帮助
谢谢
Hi
i have three file upload to store path image in database.
i want when i insert two of three pic in database (like below pic)
http://8pic.ir/images/98875708231203613698.jpg[^]
don't show null image figure in my datalist (like below pic)
http://8pic.ir/images/84846050397371303282.jpg[^]
I only want data list don't display any thing if image file path is null in the db...please help
Thanks
推荐答案
你应该使用 ASP:图像 [ ^ ]控制而不是普通的html img标签,如下所示:
You should use asp:Image[^] control instead of plain html img tag, like this:
<asp:image runat="server" AlternateText='<%# Eval("title")%>' ImageUrl='/images/htcpic/<%# Eval("image4")%>' Visible='<%# !String.IsNullOrEmpty(Convert.ToString(Eval("image4")))%>' Height="178" Width="120" />
这篇关于在datalist中的空图像图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文