Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Events not working

Status
Not open for further replies.

stevensteven

Programmer
Jan 5, 2004
108
CA
Hello,

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top