I have to store images in
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
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsForums
Top experts
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jean PaulRank #32 · 38.5K reputationPosted Feb 14, 2011, 3:39 AM EST
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);
}
Michael Xie16 reputationPosted Feb 15, 2011, 8:48 AM EST
Suthish NairRank #92 · 22.8K reputationPosted Feb 15, 2011, 9:54 PM EST