1

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.

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.

I am using ASP.NET and SQL Server 2008.

3
  • Are your images stored as binary or strings that are path's to the files on disk? Why don't you want to use a load of <img /> tags wrapped in <a/> tags? Commented Mar 21, 2011 at 12:55
  • i have just created a database for it and i m not sure of either giving a url or store it as binary, can u give an example of how to use <img/> coz the images will be increasing as the clients adds more image . Commented Mar 21, 2011 at 12:58
  • I also want to send an id of the image which is clicked to other page so that i can display details of that image Commented Mar 21, 2011 at 12:59

1 Answer 1

1

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?

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!

Sign up to request clarification or add additional context in comments.

3 Comments

is there any control in .net to achieve this
@Muhammad - No, there is no control that will do all this for you. You're going to have to write some code to implement this requirement.
I was thinking of using <asp:image button> but here images will be added by the client , nd by using asp image i will be restricted . for instance if i have a single <asp image button> , it will only display one image but in my case i have got loads of images which has to be loaded from db and dispayed on the sale page, and there is no limit for images it can be ,more then 50 or less.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.