Button won't call it's event.
called in another button:
placeHolder.Controls.Add(CreateButton());
create button:
public Button CreateButton()
{
Button btn = new Button();
btn.ID = "id";
btn.Text = "some text";
btn.Attributes.Add("onclick", "return false;");
btn.Click += new EventHandler(btn_Click);
return btn;
}
Functionality:
private void btn_Click(object sender, EventArgs e)
{
// do something.
}
places debug lines to find the source, it's simply not calling btn_Click() when clicked. What's missing?