Event Handler Stops Working After Dispose
问题 The three ImageButtons below are added to a panel (pBreakfast) in a page's codebehind: ImageButton ibSR = new ImageButton(); ibSR.ID = "ibStickyRoll"; ibSR.ImageUrl = "/images/Breakfast.gif"; ibSR.Click += new ImageClickEventHandler(ImageButton_Click); pBreakfast.Controls.Add(ibSR); ImageButton ibD = new ImageButton(); ibD.ID = "ibDoughnut"; ibD.ImageUrl = "/images/Breakfast.gif"; ibD.Click += new ImageClickEventHandler(ImageButton_Click); pBreakfast.Controls.Add(ibD); ibD.Dispose(); using