title: Nested FormView controls
body: <p>I have an asp.net form that looks something like this...</p>
  
  <pre><code>&lt;asp:Panel ID="PanelForm" runat="server" &gt;
      &lt;asp:FormView ID="FormView1" runat="server" &gt;
          &lt;asp:EditItemTemplate&gt;
              &lt;asp:FormView ID="FormView2" runat="server" &gt;
                  &lt;InsertItemTemplate&gt;
                      &lt;asp:TextBox ID="myControl" runat="server" /&gt;
                  &lt;/InsertItemTemplate&gt;
              &lt;/asp:FormView&gt;
          &lt;/asp:EditItemTemplate&gt;
      &lt;/asp:FormView&gt;
  &lt;/asp:Panel&gt;
  </code></pre>
  
  <p>I want to set the text of a <code>TextBox</code> called "myControl" to "myText".</p>
  
  <p>The code below results in <code>t = null</code> which throws an "Object reference not set to an instance of an object." error.</p>
  
  <pre><code>FormView fv2 = (FormView)FormView1.FindControl("FormView2");
  fv2.ChangeMode(FormViewMode.Insert);
  TextBox t = (TextBox)fv2.FindControl("myControl");
  t.Text = "myText";
  </code></pre>
  
  <p>How to update this <code>TextBox</code> from the code behind?</p>