网络控制/ jQuery函数从数据库显示图像? [英] Web control / jQuery function for displaying images from database?

查看:123
本文介绍了网络控制/ jQuery函数从数据库显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个用于显示产品的图像(及其价格和名称)从SQL Server数据库生成的产品销售页面。当用户点击的特定图像上,它应该定位到与更多的图像和特定产品的细节的另一页。我不知道该控制用于显示销售页面上的图像。

I want to create a product sales page that displays a product images (with their prices and names) generated from SQL Server database. When a user clicks on a specific image, it should navigate to another page with more images and details of that particular product. I don't know which control to use to display images on the sales page.

另外,管理员可以添加产品图片 - 因此,当他们添加一个新的产品,该产品应该第一个销售页面上。我可以通过编写一个简单的查询实现这一点,但我不知道我应该用什么来显示图像。我不能使用图像按钮(因为图像可以超过50个依赖),也没有我可以使用GridView控件。如果这可以通过jQuery的实现,任何帮助或援助将是非常美联社preciated。

Also, the admin can add products with images - therefore when they add a new product, that product should come the first on the sale page. I can achieve this by writing a simple query, but I don't know what I should use to display the images. I can't use image buttons (because the images can be more than 50 depends) nor can I use GridView. If this can be achieved through jQuery, any help or assistance would be highly appreciated.

我使用ASP.NET和SQL Server 2008。

I am using ASP.NET and SQL Server 2008.

推荐答案

既然你要显示在HTML页面中您的图片,你将需要使用IMG标记,简单明了。 (我敢肯定还有其他的方法来显示HTML图像,但IMG是最直接的。),你需要回答的真正的问题是如何创建网址的每个存储在我的数据库中的图像<? / STRONG>

Since you want to show your images in HTML pages, you're going to need to use the IMG tag, plain and simple. (I'm sure there are other ways to display images in HTML, but IMG is the most straightforward.) The real question you need to answer is how do I create URLs for each of the images stored in my database?

你可能会需要创建分析每个图像URL请求,从数据库中检索的图像和图像发送比特到响应流HTTP处理程序。你也可以包括像在文件系统上缓存的图像,以该处理程序执行更好的功能。

You're likely going to need to create an HTTP handler that parses each image request URL, retrieves the image from the database and sends the image bits to the response stream. You could also include features like caching the image on the file system to make the handler perform better.

希望向您发送了正确的方向!

Hope that sends you in the right direction!

这篇关于网络控制/ jQuery函数从数据库显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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