title: ASP.NET Dynamically Generated Linkbutton Click event not firing
body: <p>I have a panel with its visibility set to false.  What I'm trying to do is dynamically create a LinkButton when my page is generated and have it so when I click the LinkButton, the panels' visibility gets set to true and it appears on my page.</p>
  
  <p>I'm creating my LinkButton like so:</p>
  
  <pre><code>LinkButton _lb = new LinkButton();
  _lb.Text = "Details";
  _lb.Click += _lb_Click;
  </code></pre>
  
  <p>Here is the code for my LinkButton's Click event handlers:</p>
  
  <pre><code>protected void _lb_Click(object sender, EventArgs e)
  {
        Panel1.Visible = true;
  }
  </code></pre>
  
  <p>Whenever I render the page and click on the LinkButton, the event never fires.  I can put a break point inside the event handler and it never gets reached.  What am I missing?</p>
  
  <p>EDIT:</p>
  
  <p>I am adding the LinkButton to the page in a placeholder like so:</p>
  
  <pre><code>PlaceHolder1.Controls.Add(_lb);
  </code></pre>
  
  <p>EDIT2:</p>
  
  <p>Thank you all for the replies so far.  It seems like the problem is definitely to do with the lifecycle.  To add details, the LinkButton is being created inside of a Timer_Tick event that is controlling the updating of an UpdatePanel.  I don't know how to create the LinkButton in Page_Load and pass it to the Timer_Tick event.  Any help?</p>