how to get click event of asp linkbutton which is created using literal?
<p>I dynamically created linkbutton using literal in csharp.
i want its click event.</p>

<pre><code>for (int i = 0; i &lt; dataset.Tables[0].Rows.Count; i++)
                {
Literal literal = new Literal();
                literal.Text = @" &lt;asp:LinkButton runat='server' ID='addtocart' Text=''                       
                        OnClick='addtocart_Click'&gt;&lt;img src='images/cart.gif' alt='' title='' border='0' class='left_bt' /&gt;&lt;/asp:LinkButton&gt;";
                div.Controls.AddAt(0, lit);
}
</code></pre>

<p>i try to make event like </p>

<pre><code>protected void addtocart_Click(object sender, EventArgs e)
    {

    }
</code></pre>

<p>but not working.....!
please tell me how its click event will generate.</p>

<p>Thanks in advance.</p>
