在ASP页面中显示图像 [英] Display images in ASP Page

查看:79
本文介绍了在ASP页面中显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已将图像路径存储在数据库中...我想检索它并要在asp页面中显示图像(如果我应单击超链接或按钮图像,则应显示)...

请帮助示例代码.

问候
Jose

Already image path is being is stored in database... I want to retrieve it and want to display images in asp pages(IF I CLICK A HYPERLINK OR BUTTON IMAGE SHOULD BE DISPLAYED) ...

Plz help with sample code.

Regards
Jose

推荐答案

使用Image控件,并将ImageUrl设置为按钮click事件中从数据库检索的路径.

如果您正在寻找客户端幻灯片放映,请检查一下,

使用异步Javascipt和XML AKA Ajax进行幻灯片放映 [
Use an Image control and set ImageUrl as the path retrieved from the database in the click event of button.

If you are looking for client side slideshow check this,

Slideshow using Asynchronous Javascipt and XML A.K.A Ajax[^]

Let us know if you get your solution.


我正在考虑您使用的是ASP(带有标签).做这样的事情:
I am considering you are using ASP (as tagged). Do something like this:
<a href="UploadedFiles/<%=oRst.Fields("FileName").Value %>" ><%=oRst.Fields("FileName").Value %></a>


在哪里,
oRst 是您的Recordset对象.
FileName 是存储文件的列名.
UploadedFiles 是与您的网站位于同一目录的文件夹,文件存储在该目录中,或者最好使用Server.MapPath()将指定的相对路径或虚拟路径映射到服务器上的相应物理目录. >
我建议您购买一本书或在网上阅读一些样本,因为这是一个非常基本的问题,您至少可以在问之前进行搜索.


where,
oRst is your Recordset object.
FileName is the Column name which stores file.
UploadedFiles is a folder in the same directory as your website, where the files are stored OR better use Server.MapPath() to map the specified relative or virtual path to the corresponding physical directory on the server.

I would suggest you to buy a book or read some samples on the net because it is a very basic question and you could have at least searched for it before asking.


这篇关于在ASP页面中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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