T
Toni
I have ImageButton array. I have defined onClick event and it works. But in
this function I can not use control propetries. I want to use index of
ImageButton which is clicked and ImageURL property. How to use this?
protected void Page_Load(object sender, EventArgs e)
{
ImageButton[] HeaderImage = new ImageButton[6];
for (int n = 1; n < 6; n++)
{
HeaderImage[n] = new ImageButton();
HeaderImage[n].ImageUrl =
"Design/Templates/HeaderImage/HeaderImage"+n.ToString()+".jpg";
HeaderImage[n].Click += new
ImageClickEventHandler(HeaderImage_Click);
PanelPicture1.Controls.Add(HeaderImage[n]);
}
}
private void HeaderImage_Click(object sender, EventArgs e)
{
Response.Write(Convert.ToString(e) + "<br>");
Response.Write(Convert.ToString(sender) + "<br>");
}
this function I can not use control propetries. I want to use index of
ImageButton which is clicked and ImageURL property. How to use this?
protected void Page_Load(object sender, EventArgs e)
{
ImageButton[] HeaderImage = new ImageButton[6];
for (int n = 1; n < 6; n++)
{
HeaderImage[n] = new ImageButton();
HeaderImage[n].ImageUrl =
"Design/Templates/HeaderImage/HeaderImage"+n.ToString()+".jpg";
HeaderImage[n].Click += new
ImageClickEventHandler(HeaderImage_Click);
PanelPicture1.Controls.Add(HeaderImage[n]);
}
}
private void HeaderImage_Click(object sender, EventArgs e)
{
Response.Write(Convert.ToString(e) + "<br>");
Response.Write(Convert.ToString(sender) + "<br>");
}