如何在asp.net中从数据库中显示datalist上的图像? [英] how to display images on datalist from database in asp.net ?

查看:321
本文介绍了如何在asp.net中从数据库中显示datalist上的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Experts,

我已经开发了web应用程序。在那个应用程序中我想在datalist控件上显示图像。我尝试了很多,但我只得到了十字标记而不是实际图像。



请帮帮我........

Hello Experts,
I have developed web application .In that application i want to display images on datalist control.I tried lot but i got only cross mark instead of actual image.

Please help me........

推荐答案

检查在Asp.Net C中从SQL Server数据库显示DataList控件中的图像# VB.Net [ ^ ]


< asp:image id =Image1runat =serverclass =thumb imageurl =<%#Eval(image,〜=folder =to =save =image ={0})=%& gt;= width =95height =90xmlns:asp =#unknown>



而不是〜/ Path / image.jpg使用〜/ Path / {0}
<asp:image id="Image1" runat="server" class="thumb" imageurl="<%#Eval(" image","~="" folder="" to="" save="" image="" {0}")="" %&gt;"="" width="95" height="90" xmlns:asp="#unknown">

instead of ~/Path/image.jpg use ~/Path/{0}


引用:

只有十字标记而不是实际图像。

got only cross mark instead of actual image.

这意味着图像路径错误。



了解如何绑定图像控件的路径。还要检查浏览器开发人员收费中的图像,以查看正在呈现的路径。这将为您提供有关此问题的提示。

That means the path of images are wrong.

See how you are binding the path to the image control. Also inspect the image in browser developer toll to see what is the path being rendered. That will give you the hint of the issue you have with that.


这篇关于如何在asp.net中从数据库中显示datalist上的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆