title: Unable to find control in BottomPagerRow of GridView
body: <p>I have a very simple application that has a GridView. I have a custom BottomPagerRow that is using a drop down list and link buttons. If I attempt to use the controls while the default pages are showing it works fine, but if I change the page size any other changes forces it back to default.</p>
  
  <p>Just looking at this code myself, I can only think that because the row number is changing the ID of the controls are changing and when the server attempts to find them they no longer exist and switch to default. </p>
  
  <pre><code>&lt;asp:GridView ID="dgCQMain" runat="server" EnableViewState="false" PagerSettings-Position="Bottom" OnPageIndexChanging="dgCQMain_PageIndexChanging" AutoGenerateColumns="true" OnRowCreated="dgCQMain_RowCreated"&gt;
      &lt;HeaderStyle CssClass="gridHeaderRow" /&gt;
      &lt;AlternatingRowStyle CssClass="gridAlternatingRows" /&gt;
      &lt;PagerStyle CssClass="gridPager" /&gt;
      &lt;RowStyle CssClass="gridRow" /&gt;
      &lt;SelectedRowStyle CssClass="gridSelectedRow" /&gt;
      &lt;FooterStyle CssClass="gridFooter" /&gt;
      &lt;EmptyDataTemplate&gt;
         &lt;asp:Label ID="lblEmptyLaboratoryMain" runat="server" Text="[There are no current items for this patient]"&gt;&lt;/asp:Label&gt;
         &lt;/EmptyDataTemplate&gt;
         &lt;EmptyDataRowStyle CssClass="gridEmpty" /&gt;
         &lt;PagerTemplate&gt;
            &lt;table width="100%" cellpadding="0" cellspacing="0" border="0"&gt;
               &lt;tr class="gridPager"&gt;
                  &lt;td class="pagerNumbers"&gt;
                     &lt;asp:LinkButton CssClass="pagerNumberLinks" ID="LinkButton1" runat="server" CommandName="Page" CausesValidation="false" CommandArgument="First"&gt;&lt;&lt;&lt;/asp:LinkButton&gt;
                     |
                     &lt;asp:LinkButton CssClass="pagerNumberLinks" ID="LinkButton2" runat="server" CommandName="Page" CausesValidation="false" CommandArgument="Prev"&gt;&lt;&lt;/asp:LinkButton&gt;
                     |
                     &lt;asp:Repeater ID="rptPager" runat="server"&gt;
                        &lt;ItemTemplate&gt;
                           &lt;asp:LinkButton CssClass="pagerNumberLinks" ID="lnkPage" runat="server" Text='&lt;%#Eval("Text") %&gt;' CommandArgument='&lt;%#Eval("Value") %&gt;' Enabled='&lt;%# Eval("Enabled") %&gt;' OnClick="dgCQMainPage_Changed"&gt;&lt;/asp:LinkButton&gt;
                           &lt;span&gt;|&lt;/span&gt;
                         &lt;/ItemTemplate&gt;
                      &lt;/asp:Repeater&gt;
                   &lt;asp:LinkButton CssClass="pagerNumberLinks" ID="LinkButton4" runat="server" CommandName="Page" CausesValidation="false" CommandArgument="Next"&gt;&gt;&lt;/asp:LinkButton&gt;
                   |
                   &lt;asp:LinkButton CssClass="pagerNumberLinks" ID="LinkButton5" runat="server" CommandName="Page" CausesValidation="false" CommandArgument="Last"&gt;&gt;&gt;&lt;/asp:LinkButton&gt;
                   |
                 &lt;/td&gt;
                 &lt;td class="gridPager"&gt;
                    &lt;asp:Label ID="MessageLabel" Text="Show me" runat="server" /&gt;
                    &lt;asp:DropDownList ID="PageDropDownList" AutoPostBack="true" runat="server" OnSelectedIndexChanged="dgCQMainDropDownList_SelectedIndexChanged_Bottom"&gt;
                       &lt;asp:ListItem Text="2" /&gt;
                       &lt;asp:ListItem Text="5" /&gt;
                       &lt;asp:ListItem Text="10" /&gt;
                    &lt;/asp:DropDownList&gt;
                    &lt;asp:Label ID="Label1" Text=" results per page" runat="server" /&gt;
                 &lt;/td&gt;
              &lt;/tr&gt;
           &lt;/table&gt;
        &lt;/PagerTemplate&gt;
     &lt;/asp:GridView&gt;
  
  protected void dgCQMainDropDownList_SelectedIndexChanged_Bottom(Object sender, EventArgs e)
  {
     // Set the PageIndex property to display that page selected by the user.
     dgCQMain.PageIndex = 0;
     dgCQMain.PageSize = int.Parse((sender as DropDownList).SelectedItem.Value);
  }
  </code></pre>