stevensteven
Programmer
Hello,
I am trying to create a button and have a click event.
I am not getting the event with the following :
Why isn't my event firing?
Thanks for the help.
Steve
I am trying to create a button and have a click event.
I am not getting the event with the following :
Code:
protected Button btnReply = new Button();
private void Page_Load(object sender, System.EventArgs e)
{
//Somewhere in here I add it to a control.
}
override protected void OnInit(EventArgs e)
{
btnReply.Text = "Post Reply";
btnReply.Click += new EventHandler(this.btnAddReply_Click);
}
Why isn't my event firing?
Thanks for the help.
Steve