I know this has been posted a guzillion times but it appears that my circumstances are slightly different since the common solution is not solving the problem. My code is as follows:
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
Button btn_finishTest = new Button();
btn_finishTest.ID = "btn_finishTest";
btn_finishTest.Text = "Finish";
btn_finishTest.Click += new EventHandler(btn_finishTest_Click);
placeholder.Controls.Add(btn_finishTest);
}
private void btn_finishTest_Click(object sender, EventArgs e) {
// does sweet FA at the moment
}
As you can see, the button is instantiated on page-init, so I'm slightly purplexed as to why the click event code isn't executed.
btn_finishTest_Clickfromprivatetoprotected? - masonprivatetoprotected. - J Smith