Click event for dynamically created link buttons not firing?
<p>This is application i am doing in c# web application<br>
  I am creating link buttons dynamically as below.</p>

<pre><code>for (int i = 0; i &lt; ds.Tables[0].Rows.Count; i++)
            {         
                LinkButton ln = new LinkButton();
                ln.Text = ds.Tables[0].Rows[i].ItemArray[0].ToString();
                ln.ID =  ds.Tables[0].Rows[i].ItemArray[1].ToString();  
                divonlne.Controls.Add(ln);
                divonlne.Controls.Add(new LiteralControl("&lt;br/&gt;"));
            }
</code></pre>

<p>my click event is as follows</p>

<pre><code> ln.Click += new EventHandler(Clicked);
</code></pre>

<p>In my click event i am getting the linkbutton text and Id as follows</p>

<pre><code>   protected void Clicked(object sender, EventArgs e)
        {
            LinkButton lno = sender as LinkButton;
            Session["Toname"] = lno.Text;
            Session["idto"] = lno.ID;
        }
</code></pre>

<p>But this is firing only when the last link button is clicked.
Can anyone help me out?</p>
