arpit jodawat

arpit jodawat

  • NA
  • 10
  • 10.5k

how to set dynamically created image in horizontal way

Oct 29 2010 4:57 AM
My Prog. is:

if (rdr2 != null)
                {
                    System.Web.UI.WebControls.Panel pan = new System.Web.UI.WebControls.Panel(); 
                    pan.Width = new System.Web.UI.WebControls.Unit("150px");
                    System.Web.UI.WebControls.Image im = new System.Web.UI.WebControls.Image();
                    im.Height = new System.Web.UI.WebControls.Unit("100px");
                    im.Width = new System.Web.UI.WebControls.Unit("100px");
                    im.ImageUrl = rdr2[0].ToString ();
                    pan .Controls.Add(im);
                    this.Controls.Add(pan);
                    countpic = countpic + 1;
                    if (countpic == 4)
                    {
                        this.Controls.Add(new LiteralControl("<BR>"));
                        this.Controls.Add(new LiteralControl("<BR>"));
                        countpic = 0;
                    }
                    else
                    {
                        this.Controls.Add(new LiteralControl("&nbsp;"));
                        this.Controls.Add(new LiteralControl("&nbsp;"));
                    }
}

this gives images in vertical wise 
means

1st image
2nd image
.
.
.



but i want  images in horizontal way.