Link to home
Start Free TrialLog in
Avatar of Tapan Pattanaik
Tapan PattanaikFlag for India

asked on

binding image control to dataset

I have a image control in my asp.net page. I am retrieving image paths and stored on dataset and want to bind to image control. (how will i do it without gridview)

example : if 10 image paths coming from dataset then it will automatically  display 10 images in webpage. How will i do it.
Avatar of Kishan Zunjare
Kishan Zunjare
Flag of Australia image

Hi TAPAN,

First you have to do for loop, get one by one path from dataset; take some placeholder in aspx page like any table or panel and then in For loop create new object of image and add this image control to that placeholder.


This is psuedo code;
for (int i = 0; i < datasetCount; i++){
Image image = new Image ();
Image1.ImageUrl = path;
placeholder.Controls.Add(image);
}

Hope this helps;
-Kishan
Avatar of Tapan Pattanaik

ASKER

Hi Kishan,

can you share more in depths.
ASKER CERTIFIED SOLUTION
Avatar of Kishan Zunjare
Kishan Zunjare
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks to all.