在te数据库中设置图像链接 [英] set the image link in te database

查看:78
本文介绍了在te数据库中设置图像链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为"images"的文件夹,其中包含图像.
我创建了一个数据库来存储相同的图像.我正在显示这些图像从数据库到gridview.现在我想设置图像的链接.也就是说,如果用户点击图片,他将被重定向到新页面中图片"文件夹中的同一图片.
如果我使用超链接或图像映射在网格视图中显示图像.我应该在URL中写些什么来重定向用户?

i have a folder named "images" which contains images.
i have one database created to store the same images. i am displaying these images from database to gridview. now i want to set the link for the images. i.e. if user clicks on the image he will be redirect to the same image in the folder "images" in the new page.
if i am using an hyperlink or image map to display image in the grid view. what should i have to write in the url to redirect the user?
code in c# only.

推荐答案

要完成此操作,数据库中的imageName应该与存储在本地文件夹中的图像相同.
然后,绑定时简单"在模板字段中使用锚标记.

To accomplish this thing There should be imageName in Database as same as which is in images stored in Local Folder.

Then Simple While Binding use Anchor Tag in the Template Field.

<a href="<%# String.Format("Location of your Folder/{0}",DataBinder.Eval(Container.DataItem,"imageName")) %>"></a>



希望对您有所帮助,



Hope This Helps,


这篇关于在te数据库中设置图像链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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