How to draw link button in grid view item template which don't get erased on link button click?
<p>i want to add buttons in gridview item template at run time,
i am drwaing it using panel like below
the uttons draw properly but get erased on post beack when i click to the link button and it's registered clicked event don't get fired.
please help me with, how to persist the link button on post back without erasing the link button?</p>

<pre><code>&lt;asp:GridView ID="mealDealGrid" runat="server" AllowPaging="false" AutoGenerateColumns="False"
                    EnableModelValidation="True" OnRowDataBound="mealDealGrid_RowDataBound"&gt;
                    &lt;Columns&gt;
                        &lt;asp:TemplateField HeaderText="Category Items"&gt;
                            &lt;ItemTemplate&gt;
                                &lt;div class="list_dish"&gt;
                                    &lt;div&gt;
                                        &lt;div class="dsh_img"&gt;
                                            '&lt;%#Eval("MealDealName")%&gt;'
                                            &lt;div class="clear"&gt;
                                            &lt;/div&gt;
                                        &lt;/div&gt;
                                        &lt;div class="select_optn"&gt;
                                            &lt;%#Eval("Description")%&gt;
                                            &lt;asp:Panel ID="itemButtonPnl" runat="server"&gt;
                                            &lt;/asp:Panel&gt;
                                            &lt;div class="clear"&gt;
                                            &lt;/div&gt;
                                        &lt;/div&gt;
                                        &lt;div class="select_optn"&gt;
                                            &lt;%#Eval("Amount")%&gt;
                                            &lt;div class="clear"&gt;
                                            &lt;/div&gt;
                                        &lt;/div&gt;
                                        &lt;div style="float: left;"&gt;
                                        &lt;/div&gt;
                                    &lt;/div&gt;
                                &lt;/div&gt;
                            &lt;/ItemTemplate&gt;
                        &lt;/asp:TemplateField&gt;
                    &lt;/Columns&gt;
                    &lt;HeaderStyle CssClass="product" /&gt;
                &lt;/asp:GridView&gt;
</code></pre>

<p>and code behind code</p>

<pre><code>  protected void mealDealGrid_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Panel itemButtonPnl = (Panel)e.Row.FindControl("itemButtonPnl");
            if (itemButtonPnl != null)
            {
                cMealDeal objMealDeal = (cMealDeal)e.Row.DataItem;
                foreach (cMealDealItem objMealItem in objMealDeal.Items)
                {
                    LinkButton lbtn = new LinkButton();
                    lbtn.Text = objMealItem.CategoryInfo.CategoryName.ToString();//objMealItem.SizeInfo.SizeDescription.ToString() + " " + 
                    lbtn.ID = "cMealDealItem" + objMealItem.MealID.ToString() + "," + objMealItem.CategoryID.ToString() + "," + objMealItem.SizeID + "," + objMealItem.Quantity.ToString();
                    lbtn.CommandArgument = objMealItem.CategoryID.ToString() + "," + objMealItem.SizeID;
                    itemButtonPnl.Controls.Add(lbtn);
                    lbtn.Click += new EventHandler(this.btnMealDeal_Click);
                    //btnItems.Name = mdi.MealID.ToString() + "," + mdi.CategoryID.ToString() + "," + mdi.SizeID + "," + mdi.Quantity.ToString();

                }
                // itemButtonLiteral.Text = GenerateHTMLForCurrentMealDealItem(objMealDeal);
            }
        }
    }
    void btnMealDeal_Click(object sender, EventArgs e)
    {
        Button clickedButton = (Button)sender;
        string sb = clickedButton.CommandArgument;
        string[] arg=sb.Split(',');
        chkItem.DataSource = cProduct.GetProductOptionForCategory(int.Parse(arg[0]), int.Parse(arg[1]), cWebUtil.CurrClientID);
        ModalPopupExtender1.Show();

    }
</code></pre>
