How to maintain state of a Textbox in headertemplate of TemplateField in a GridView?
<p>I have a Gridview in which I have added a TemplateField,
which contains TextBox and a Imagebutton in HeaderTemplate,</p>

<p>When I click on the Imagebutton the textbox becomes blank.</p>

<p>I wonder how do I save state of the textbox?</p>

<pre><code>    &lt;asp:TemplateField&gt;
    &lt;HeaderTemplate&gt;
        &lt;table width="100%"&gt;
            &lt;tr&gt;
                &lt;td align="center"&gt;
                    Title&lt;br /&gt;
                    &lt;br /&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td align="center"&gt;
                    &lt;table border="0" cellpadding="0" cellspacing="0"&gt;
                        &lt;tr&gt;
                            &lt;td&gt;
                                &lt;asp:TextBox ID="txtFilterTitle" runat="server" Width="105px" EnableViewState="true"&gt;&lt;/asp:TextBox&gt;
                            &lt;/td&gt;
                            &lt;td style="padding-left: 5px;"&gt;
                                &lt;asp:ImageButton ID="imgbtnFilterTitle" ImageUrl="~/Images/Filter.png" Width="16"
                                    Height="16" runat="server" OnClick="RebindGrid" /&gt;
                            &lt;/td&gt;
                        &lt;/tr&gt;
                    &lt;/table&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/HeaderTemplate&gt;
    &lt;ItemTemplate&gt;
        &lt;%# DataBinder.Eval(Container.DataItem, "PROD_TITL")%&gt;
    &lt;/ItemTemplate&gt;
    &lt;/asp:TemplateField&gt;
</code></pre>

<p><a href="http://i.stack.imgur.com/4xXZu.png" rel="nofollow">http://i.stack.imgur.com/4xXZu.png</a></p>
