Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I access an image in a DataList control?

Status
Not open for further replies.

InsideEdge

Instructor
Apr 5, 2005
35
US
Hi, my program uses a DataList to show a list of images that are loaded from a database. I would like to be able to click on each image and have each image go to hyperlink to a larger version of the same image. I tried converting the image control to run at server thinking that I could put individual code in the image click event but it’s not doable.
Now the images are not showing and I get some text that shows next to the image. Here’s the text.

" id="_ctl1_ProductsList1_list__ctl0_IMG1" vspace="10" border="0" />

Can someone help me to put code in the click event of each separate image even though the image is in a DataList control?

Thanks,

InsideEdge


 
look on google for the OnDataBound (or on DataBinding) event.

or you can create a link around the thumbnail in your datalist if you are pulling back the location of the larger image in your dataset that is bound to the datalist.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top