3
Answers

images to fill in without image control

Hi,

  I have to store images in <td> in aspx page. i don't want  to take image control. my images will come from database. and as its count increses no. of <td> will repeated.
if i take image control then its hard for me to assign many images to same image control. so any idea, which will directly put image in <td> will be appreciated.
Answers (3)
0
Suthish Nair

Suthish Nair

NA 30.5k 7.2m 14y
If your query got resolved, then accept the post that helped you as Answer.
0
Michael Xie

Michael Xie

NA 41 8k 14y
I am not very clearly about which kind of purpose you want to show the image for.   Gridview could display image also. You could try.
0
Jean Paul

Jean Paul

24 43k 9.5m 14y
You can place a container control (for eg: Panel) in the webpage..

Then, from the page_load event fetch the images and create an image control dynamically
and add to the panel Controls property..

Hope the following code could give more idea: (before running this add an img1.png to your web app)

           protected void Page_Load(object sender, EventArgs e)
        {
            Panel panel = new Panel();
            this.Page.Controls.Add(panel);
           
            Image image = new Image();
            image.ImageUrl = "~/img1.png";
            panel.Controls.Add(image);

            image = new Image();
            image.ImageUrl = "~/img1.png";
            panel.Controls.Add(image);

        }