title: Unable to Find the Control from codebehind, but able to find other controls
body: <p>I am able to find the controls of all of these Lables and TextBoxes accept the edateTB.  This is strange to me because it is in the same view as the sdateTB.  So why would edateTB return NULL when I try to use FindControl on it and sdateTB return the correct control?</p>
  
  <p>Thanks in Advance, this one has been frustrating me for awhile.</p>
  
  <p>Here is the codebehind where I am getting this error.  There is more code in this, but I just thought I would include everything up to the part where I get the NULL error.</p>
  
  <pre><code> protected void ReservationDetail_DataBound(object sender, EventArgs e)
  {
  
  
      TextBox idBox = (TextBox)dvReservationDetail.FindControl("tbID");
      int id = int.Parse(idBox.Text);
      Label specDays = (Label)dvReservationDetail.FindControl("DaysHdr");
      Label weekdays = (Label)dvReservationDetail.FindControl("WeekdaysHdr");
      ListBox dates = (ListBox)dvReservationDetail.FindControl("DatesList");
      Label days = (Label)dvReservationDetail.FindControl("WeekdaysLbl");
      Label sdate = (Label)dvReservationDetail.FindControl("startDateLbl");
      TextBox sdateTb= (TextBox)dvReservationDetail.FindControl("startDateTB");
      Label eDate = (Label)dvReservationDetail.FindControl("endDateLbl");
      TextBox edateTB = (TextBox)dvReservationDetail.FindControl("endDateTB");
  }
  </code></pre>
  
  <p>Here is the Detailsview where the labels and Textboxes are.</p>
  
  <pre><code>&lt;asp:DetailsView ID="dvReservationDetail" runat="server" DataSourceID="SqlDetail"
                      OnDataBound="ReservationDetail_DataBound" CssClass="detailgrid" GridLines="None"
                      DefaultMode="Edit" AutoGenerateRows="false" Visible="false" Width="100%" OnItemUpdating="ReservationDetail_Updating"&gt;
                      &lt;Fields&gt;
                          &lt;asp:TemplateField HeaderText="ID"&gt;
                              &lt;EditItemTemplate&gt;
                                  &lt;asp:TextBox ID="tbID" runat="server" Text='&lt;%# Bind("id") %&gt;' ReadOnly="true" /&gt;
                              &lt;/EditItemTemplate&gt;
                          &lt;/asp:TemplateField&gt;
                          &lt;asp:BoundField HeaderText="LabName" DataField="labName" /&gt;
                          &lt;asp:BoundField HeaderText="Class" DataField="class" /&gt;
                          &lt;asp:BoundField HeaderText="Class Size" DataField="classSize" /&gt;
                          &lt;asp:TemplateField HeaderText="Software"&gt;
                              &lt;EditItemTemplate&gt;
                                  &lt;asp:ListBox ID="software" Width="150" runat="server" ReadOnly="true" /&gt;
                              &lt;/EditItemTemplate&gt;
                          &lt;/asp:TemplateField&gt;
                          &lt;asp:TemplateField HeaderText="Start Time"&gt;
                              &lt;EditItemTemplate&gt;
                                  &lt;asp:TextBox ID="startTime" runat="server" Text='&lt;%# Bind("startTime") %&gt;' /&gt;
                              &lt;/EditItemTemplate&gt;
                          &lt;/asp:TemplateField&gt;
                          &lt;asp:TemplateField HeaderText="End Time"&gt;
                              &lt;EditItemTemplate&gt;
                                  &lt;asp:TextBox ID="endTime" runat="server" Text='&lt;%# Bind("endTime") %&gt;' /&gt;
                              &lt;/EditItemTemplate&gt;
                          &lt;/asp:TemplateField&gt;
                          &lt;asp:TemplateField&gt;
                              &lt;HeaderTemplate&gt;
                                  &lt;asp:Label ID="WeekdaysHdr" runat="server" Visible="false" Text="Days Reserved By Week"&gt;&lt;/asp:Label&gt;
                                  &lt;asp:Label ID="DaysHdr" runat="server" Visible="false" Text="Specific Days Reserved"&gt;&lt;/asp:Label&gt;
                              &lt;/HeaderTemplate&gt;
                              &lt;ItemTemplate&gt;
                                  &lt;asp:ListBox ID="DatesList" runat="server" Visible="false"&gt;&lt;/asp:ListBox&gt;
                                  &lt;asp:Label ID="WeekdaysLbl" runat="server" Text='&lt;%# Bind("Weekday") %&gt;' Visible="false"&gt;&lt;/asp:Label&gt;
                              &lt;/ItemTemplate&gt;
                          &lt;/asp:TemplateField&gt;
                          &lt;asp:TemplateField&gt;
                              &lt;HeaderTemplate&gt;
                                  &lt;asp:Label ID="startDateLbl" runat="server" Visible="false" Text="Start Date"&gt;&lt;/asp:Label&gt;&lt;/HeaderTemplate&gt;
                              &lt;ItemTemplate&gt;
                                  &lt;asp:TextBox ID="startDateTB" runat="server" Visible="false" Text="Test"&gt;&lt;/asp:TextBox&gt;&lt;/ItemTemplate&gt;
                          &lt;/asp:TemplateField&gt;
                          &lt;asp:TemplateField&gt;
                              &lt;HeaderTemplate&gt;
                                  &lt;asp:Label ID="endDateLbl" runat="server" Visible="false" Text="End Date"&gt;&lt;/asp:Label&gt;&lt;/HeaderTemplate&gt;
                              &lt;ItemTemplate&gt;
                                  &lt;asp:TextBox ID="endDateTB" runat="server" Visible="false" Text=""&gt;&lt;/asp:TextBox&gt;&lt;/ItemTemplate&gt;
                              &lt;ItemTemplate&gt;
                                  &lt;asp:TextBox ID="repeatTypeTB" runat="server" Visible="false" Text='&lt;%# Bind("repeats") %&gt;'&gt;&lt;/asp:TextBox&gt;&lt;/ItemTemplate&gt;
                          &lt;/asp:TemplateField&gt;
                          &lt;%-- &lt;asp:CommandField ShowEditButton="true" /&gt;--%&gt;
                      &lt;/Fields&gt;
                  &lt;/asp:DetailsView&gt;
  </code></pre>