在表格控件中显示图像 [英] Displaying Image in Table Control

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

问题描述



目前,我正在从事电子商务应用程序的开发,其中一个页面应使用linq显示产品图像,该图像是通过WCF服务从数据库中获取的.

我的问题是在页面加载期间,图像应该在asp.net表控件的tablecell中动态显示.

我已经从WCF中获取了数据,但是无法使用asp.net图像控件在表格单元中显示图像.

任何想法/建议/解决方案都是最受邀请的.

问候,
Raghuveer

Hi,

Currently I am working on eCommerce application, wherein a page should display the product image using linq, being fetched from the database via a WCF service.

My problem is that the images should be displayed dynamically inside the tablecell of the asp.net table control during page load.

I have fetch the data from WCF but unable to display the image inside the tablecell using asp.net Image control.

Any Idea / suggestions / solutions are most invited.

Regards,
Raghuveer

推荐答案

如果将图像存储在数据库中(二进制),则必须创建一个通用处理程序来显示该图像.它可以使用BinaryWrite显示图像.
然后,您将拥有一个文件,该文件将基于querystring参数(imageId = 123)显示数据库中的图像.

然后使用src ="yourHandler.ashx?imageId = 123"
If you store your image in the database (binary), you will have to create a generic handler to show that image.It can use a BinaryWrite to show the image.
Then you have a file that will show images from your database based on a querystring parameter (imageId=123).

And then add a in your table with src="yourHandler.ashx?imageId=123"


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

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