How to fix this error in GridView?
<p>I am trying to use the <a href="http://www.misfitgeek.com/2011/06/filtering-an-asp-net-gridview-control-with-jquery/" rel="nofollow">Search Box that is explained in this blog</a>. The problem now I have a GridView inside the Repeater. This GridView will be generated based on the value of the HiddenField. I used the code as explained in the blog but when I tried to use it in my case, I got an error which I don't know why I am getting it each time. The error that I got was from the code-behind and the error was:</p>

<p><em><strong>The name 'GridView1' does not exist in the current context.</em></strong></p>

<p>So HOW TO FIX THIS ERROR?</p>

<p>My ASP.NET Code:</p>

<pre><code>&lt;input id=id_search type=text placeholder="Search"&gt;


     &lt;br /&gt;  &lt;br /&gt;  
        &lt;asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1"&gt;
            &lt;ItemTemplate&gt;

                &lt;asp:HiddenField ID="HiddenField1" runat="server" Value='&lt;%# Eval("GroupID")%&gt;' /&gt;

                &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                    ConnectionString="&lt;%$ ConnectionStrings:testConnectionString %&gt;" 
                                    SelectCommandType="StoredProcedure" SelectCommand="kbiReport"
                                    FilterExpression="[DivisionName] like '{0}%'"&gt;

                    &lt;FilterParameters&gt;
                        &lt;asp:ControlParameter ControlID="ddlDivision" Name="DivisionName" 
                                                 PropertyName="SelectedValue" Type="String" /&gt;
                    &lt;/FilterParameters&gt;

                    &lt;SelectParameters&gt;
                        &lt;%--ControlParameter is linked to the HiddenField above to generate different GridView based on different values 
                            of GroupID--%&gt;
                        &lt;asp:ControlParameter ControlID="HiddenField1" Name="GroupID" PropertyName="Value" /&gt;
                    &lt;/SelectParameters&gt;
                &lt;/asp:SqlDataSource&gt;

                &lt;asp:GridView ID="GridView1" runat="server" 
                                AllowSorting="True" 
                                CellPadding="3" 
                                DataSourceID="SqlDataSource1" 
                                ClientIDMode="Static"
                                CssClass="mGrid"
                                AlternatingRowStyle-CssClass="alt" 
                                RowStyle-HorizontalAlign="Center" 
                                OnRowDataBound="GridView1_RowDataBound" OnPreRender="GridView1_PreRender"&gt;
                    &lt;AlternatingRowStyle BackColor="White" ForeColor="#284775" /&gt;
                    &lt;HeaderStyle Font-Bold = "true" ForeColor="Black"/&gt; 
                    &lt;Columns&gt;
                        &lt;asp:CommandField ShowSelectButton="True" /&gt;
                    &lt;/Columns&gt;
                    &lt;EditRowStyle BackColor="#999999" /&gt;
                    &lt;FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /&gt;
                    &lt;PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /&gt;
                    &lt;RowStyle BackColor="#F7F6F3" ForeColor="#333333" /&gt;
                    &lt;SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /&gt;
                    &lt;SortedAscendingCellStyle BackColor="#E9E7E2" /&gt;
                    &lt;SortedAscendingHeaderStyle BackColor="#506C8C" /&gt;
                    &lt;SortedDescendingCellStyle BackColor="#FFFDF8" /&gt;
                    &lt;SortedDescendingHeaderStyle BackColor="#6F8DAE" /&gt;
                &lt;/asp:GridView&gt;

            &lt;/ItemTemplate&gt;
        &lt;/asp:Repeater&gt;

        &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                           ConnectionString="&lt;%$ ConnectionStrings:testConnectionString %&gt;"
                           SelectCommand="SELECT DISTINCT GroupID FROM courses"&gt;
        &lt;/asp:SqlDataSource&gt;
</code></pre>

<p>My Code-Behind:</p>

<pre><code>protected void GridView1_PreRender(object sender, EventArgs e)
    {
        if (GridView1.Rows.Count &gt; 0)
        {
            GridView1.UseAccessibleHeader = true;
            GridView1.HeaderRow.TableSection = TableRowSection.TableHeader;
        }
    }
</code></pre>
