3 Replies - 1773 Views - Last Post: 12 June 2013 - 01:40 PM Rate Topic: -----

#1 javedparamount  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 28-July 09

Get Images from database in asp.net and a bit more...

Posted 11 June 2013 - 12:19 AM

how to handle the following situation?

My one web form shows (suppose) 10 thumbnails with captions. These thumbnails stored in a folder.
Every thumbnail belongs to another large image that is stored in a different folder. I am using SQL Server database and storing Large images path in my data table.

Now what i am trying to get is that if user click on a Thumbnail following two actions should occur:

1). A new aspx web form will be opened ( suppose Named "Armani").
2). Query will be executed and Data related to the thumbnail (Clicked by user) should be retrieved (including large image) on web form "Armani"

My confusion : How to link thumbnails with large images and other information stored in database.

Further more, I want to display information in two columns on newly opened web form named "Armani". One column will display Large Image and second column will display e.g Brand name, Price, Color, size, etc.

Is This A Good Question/Topic? 0
  • +

Replies To: Get Images from database in asp.net and a bit more...

#2 jace75  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 31
  • Joined: 11-June 13

Re: Get Images from database in asp.net and a bit more...

Posted 11 June 2013 - 08:32 PM

Sure, this is very simple to accomplish. You'll need a path to thumbnail, and a path to the full size image. Both file paths should be fields in you table, lets call it the Products table. When the Products table information is loaded in the main catalog page, you'll need to display the the table's thumbnail field. When you click on the table, you'll go to the product details page, and there you'll need to display the table's full size image field. This can all also be done on the same page using Server-Side scripting. If you want to really show off, you could also create a CSS/Javascript onHover() event to display the full sized image when you mouse over B)

Oh, and all the other detail information will work the same way. First, make all the columns you need in your database for both pages, and then choose which ones you want to display on each page.
Was This Post Helpful? 0
  • +
  • -

#3 javedparamount  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 28-July 09

Re: Get Images from database in asp.net and a bit more...

Posted 11 June 2013 - 11:38 PM

View Postjace75, on 11 June 2013 - 08:32 PM, said:

Sure, this is very simple to accomplish. You'll need a path to thumbnail, and a path to the full size image. Both file paths should be fields in you table, lets call it the Products table. When the Products table information is loaded in the main catalog page, you'll need to display the the table's thumbnail field. When you click on the table, you'll go to the product details page, and there you'll need to display the table's full size image field. This can all also be done on the same page using Server-Side scripting. If you want to really show off, you could also create a CSS/Javascript onHover() event to display the full sized image when you mouse over B)/>

Oh, and all the other detail information will work the same way. First, make all the columns you need in your database for both pages, and then choose which ones you want to display on each page.


Well thank you for your response. Could you give me some idea about how to arrange thumbnails in the main catalog page while these thumbnails are retrieved from "product Table". Currently I have arranged these thumbnails manually using css but these are not coming from "Product Table" but only the folder. You can see the image file attached herewith.

Catalog page only displays two fields "Thumbnail" & "Name" of each product item. I know data from product table can be displayed using "Gridview". But I don't know what to use if I want to display image?

hope you understand my question.

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#4 jace75  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 31
  • Joined: 11-June 13

Re: Get Images from database in asp.net and a bit more...

Posted 12 June 2013 - 01:40 PM

"Could you give me some idea about how to arrange thumbnails in the main catalog page while these thumbnails are retrieved from "product Table". Currently I have arranged these thumbnails manually using css but these are not coming from "Product Table" but only the folder."

Right, you shouldn't ideally store image data in your database table, only the path and name of the image. As for how to display the images, there really is no best practice. I'm sure you're familiar with html tables and asp gridviews. You can style these to your heart's content. Image data can certainly be stored in a gridview. The code in this link was written for asp 2.0, but the gridview syntax is completely valid:

http://msdn.microsof...y/aa479350.aspx

since tables are more of a clunky primitive content container, you may find it easier to work with <p> tags instead.
Kind of like this...

 
<div id="myContent">

<% foreach(DataTable row in GetMyDataTable().rows) { %>
<p>
    label here
</p>
<p>
    image here
</p>
<p>
    other content here
</p>
<p>
    price here
</p>
<% } %>
</div>



in this piece of example code, each <p> tag could be assigned a seperate CSS class, as can each asp control. You can use extremely structured(gridview) to extremely flexible(<p> or <div> tags) and everywhere in between! If you're not familiar with server scripts, the <% %> tags can be used to inject c# or VB(whichever you use) into your aspx page. http://www.w3schools...=demo_asp_ucase


The MOST important tip I can give you about site design is to start with a pencil and paper! Write out what you(and your client) want to happen for the look and feel of your site.

Check out the flash content going on at Ralph Lauren! Notice the way varying image sizes make a visual impact!
http://www.ralphlaur...global_children

Easily done with a jquery slideshow:
http://www.dynamicwp...lery-tutorials/

You could add a promotional value to your database (bool isPromotional = true/false) and set the promotionals to display on a slider or in some dramatic fashion, just a thought.

With modern CSS and Javascript, the only limit is your own knowlege of the code. I highly recommend w3Schools.com as an all around resource for simple code snippets.

Be CREATIVE :) Sometimes we forget that there are really an unlimited number of possibilities for web design. Sites like ebay, facebook, and skydrive have barely scratched the surface. I don't recommend alot of CSS 3.0 just yet, because there are ALOT of browsers that do not support it(i know business clients still running off of IE 6!) Just come up with some ideas, and put 'em in code! B)
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1