我的数据表中有一个要求。 我有3列。
serverpath,image name, id
现在我需要从数据表[serverpath]获取imagepath并将其绑定在repeater控件或gridview控件中,并在那里显示缩略图。实际上在路径d:/application/images
文件夹中我有图像。
当我绑定到转发器控件或网格控件时,我需要将原始图像转换为缩略图并在reater控件中显示。在(5x5)行x列中,但我只需要显示缩略图,而不需要[server path,id]等其他详细信息。
例如:
thumailimge1 thumailimge2 thumailimge3 thumailimge4 thumailimge5
thumailimge6 thumailimge7 thumailimge8 thumailimge9 thumailimge10
所以一旦用户点击这个缩略图,orignal图像就会显示在一个新窗口中
希望我的问题很明确......
我该如何实现此功能? 任何帮助将不胜感激
答案 0 :(得分:0)
你可以编写一个自定义的asp.net处理程序(甚至是一个普通的aspx页面,你可以手动写入Response)来将图像作为转发器中img标记的来源提供
ASHX:
http://www.codeproject.com/KB/aspnet/CustomImageHandler.aspx
http://dotnetperls.com/ashx-handler
ASPX:
http://weblogs.asp.net/whaggard/archive/2003/03/23/4180.aspx