Any dynamically created controls need t be recreated upon postback. If this
code is in your page class, then this is typically done in Page_Init (but
can be done elsewhere).
-Brock
DevelopMentor
http://staff.develop.com/ballen
> Hi all - I'm creating a link button at runtime, and putting in a table
> cell, and then trying to hook up the click event handler... but it's
> not working. Here's the code, any idea what might be wrong? Thanks!!!
> Sheryl
>
> private void AddTopicToTable(dsPersonnelDevelopment m_dsPD)
>
> {
>
> ... other stuff
>
> btnAddTraining = new System.Web.UI.WebControls.LinkButton();
>
> btnAddTraining.CssClass="Button";
>
> btnAddTraining.Text= "Insert New Training";
>
> btnAddTraining.ID="btnAddTraining";
>
> oCell.Controls.Add(btnAddTraining);
>
> btnAddTraining.Click += new
> System.EventHandler(this.btnAddTraining_Click);
>
> }
>
> public void btnAddTraining_Click(object sender, System.EventArgs e)
>
> {
>
> }
>