1
我想從後面的代碼爲每個ImageButton分配事件,但我找不到如何編寫正確的事件。將事件分配給ImageButton.Click從後面的代碼
foreach (string one in urls)
{
ImageButton temIBTN = new ImageButton();
temIBTN.Attributes.Add("Width","265px");
temIBTN.Attributes.Add("Width", "144px");
temIBTN.ImageUrl = one;
temIBTN.Click +=
new EventHandler(setBigPic(sender, e, one));//<---don't know how...
}
protected void setBigPic(object sender, ImageClickEventArgs e,string url)
{
img_Big.ImageUrl = url;
}