title: Accessing data from dynamic control in gridview
body: <p>On <code>Grid_RowDataBound</code> I have added a table in the 8th cell of the current row. This table is like:</p>
  
  <pre><code>&lt;table rules="all" border="0" style="width:100%;"&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td align="center"&gt;&lt;input name="studentgrd$ctl03$ID2VAL4" type="text" value="6" maxlength="2" id="studentgrd_ctl03_ID2VAL4" style="width:20px;"&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>On save button click, I tried to get the data using:</p>
  
  <pre><code>TextBox tb = (TextBox)studentgrd.FindControl("ID2VAL4");
  TextBox tb = (TextBox)studentgrd.Rows[i].Cells[8].FindControl("ID2VAL4");//When looping through all rows
  </code></pre>
  
  <p>But the textboxes were null. So are the dynamic controls lost on postback? If yes, then how to retain it? If it is not, where am I going wrong? </p>