I am running the following code, control was made but can not handle. Why ?
protected void Page_Load(object sender, EventArgs e)
{
Button Bt = new Button();
Bt.ID = "ButtonID";
Bt.Text = "Button Text";
Bt.Click += new EventHandler(this.test);
i.Controls.Add(Bt);
}
protected void test(object sender, EventArgs e)
{
Label1.Text = "Test";
}
testmethod is not called?i? What happens if you move it toPage_Init?Page_Loadis acceptable for creation of dynamic controls.i? Knowing that might be all the information we need to answer this one.