title: Unable to cast object of type 'System.Web.UI.WebControls.Label' to type 'System.Web.UI.WebControl
body: <p>This is what my aspx page looks like:</p>
  
  <pre><code>&lt;asp:TemplateField HeaderText="Detail" HeaderStyle-ForeColor="DimGray" &gt;
    &lt;ItemTemplate&gt;
      &lt;asp:Label ID="labeldetail" runat="server" Text='Label' &gt;&lt;/asp:Label&gt;
    &lt;/ItemTemplate&gt;
  &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>In aspx.cs, adding values to grid:</p>
  
  <pre><code> public void Addtogrid()
   {
      string ctrlStr = String.Empty;
  
      foreach (string ctl in Page.Request.Form)
      {  
         if (ctl.Contains("Longitude"))
         {
            ctrlStr = ctl.ToString();
            Disctrict.School[0].Student[j].Activity[k].Sport = Request.Form[ctrlStr];
         }
      }
   }
  
   protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
   {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
       Label lbl7 = (Label)e.Row.FindControl("labeldetail");
       if (lbl7 != null)
       {
         lbl7.Text =  Disctrict.School[0].Student[j].Activity[[e.Row.RowIndex].Sport ;
       }
     }
   }
  
   protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
   {
      foreach (Control ctrl in ControlsPanel.Controls)
      {
        if (ctrl.ClientID.Contains("Sport"))
        {
          ((TextBox)ctrl).Text = Disctrict.School[0].Student[0].Activity[x].Sport // &lt;--- Getting error here....
        }
      }
   }
  </code></pre>
  
  <p>I don't understand what am I missing. There are 16 other items that I have in the same <code>GridView</code> and everything works just perfectly fine.           </p>