title: Gridview FooterRow textbox text is null when accessing from code behind
body: <p>I have a GridView with the following columns</p>
  
  <p></p>
  
  <pre><code>     &lt;asp:TemplateField HeaderText="Name"&gt;
           &lt;FooterTemplate&gt;
               &lt;asp:TextBox ID="txt_Name" runat="server"&gt;&lt;/asp:TextBox&gt;
           &lt;/FooterTemplate&gt;
         &lt;ItemTemplate&gt;
           &lt;asp:Label ID="lbl_name" runat="server" Text='&lt;%# DataBinder.Eval(Container.DataItem, "t_Name") %&gt;' /&gt;             
         &lt;/ItemTemplate&gt;  
         &lt;EditItemTemplate&gt;
           &lt;asp:TextBox ID="txt_name" runat="server" Width="100px" Text='&lt;%#DataBinder.Eval(Container.DataItem,"t_Name") %&gt;'&gt;&lt;/asp:TextBox&gt;
         &lt;/EditItemTemplate&gt;        
       &lt;/asp:TemplateField&gt;
  
       &lt;asp:TemplateField HeaderText="Created By"&gt;
         &lt;ItemTemplate&gt;
            &lt;asp:Label ID="lbl_tabcreatedby" runat="server" Text='&lt;%# DataBinder.Eval(Container.DataItem, "t_CreatedBy") %&gt;' /&gt;
         &lt;/ItemTemplate&gt;
       &lt;/asp:TemplateField&gt;
  
         &lt;asp:CommandField HeaderText="Modify" ShowEditButton="True" /&gt;
  
         &lt;asp:CommandField HeaderText="Delete" ShowDeleteButton="True" /&gt;
  
         &lt;asp:TemplateField HeaderText="Add a New Name"&gt;
             &lt;FooterTemplate&gt;
                 &lt;asp:LinkButton ID="lnkbtn_AddName" runat="server" CommandName="Insert"&gt;Add Name&lt;/asp:LinkButton&gt;
             &lt;/FooterTemplate&gt;
         &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>And then in the Code Behind I am trying to access the txt_Name Textbox as </p>
  
  <pre><code>protected void gv_Name_RowCommand(object sender, GridViewCommandEventArgs e)
  {             
    string t_Name = ((TextBox)(gv_Name.FooterRow.FindControl("txt_Name"))).Text;
    // Insert Code
  }
  </code></pre>
  
  <p>But I am getting null in the string t_Name everytime irrespective of what is the current Text of txt_Name.
  However I can get the text if I disable the ViewState for the page. Any explanation.</p>