Adding events to dynamically created controls

Adding events to dynamically created controls sounds like it might be tricky but it's actually pretty straightforward.

System.Web.UI.WebControls.Button btn = new System.Web.UI.WebControls.Button()
btn.Click += new System.EventHandler(button_Click);
protected void button_Click(object sender, EventArgs e)
{
//Call whatever methods you please
}
Print | posted on Friday, April 14, 2006 1:55 PM

Feedback

No comments posted yet.
Title  
Name
Email (never displayed)
Url
Comments   
Please add 1 and 3 and type the answer here: