title: Problem finding a control within a FormView from code-behind
body: <p>Here the code behind... I'm trying to retrieve this control so I can add items to the drop down list (I'm retrieving the Role Groups to add to the drop down list in the code-behind)</p>
  
  <pre><code>Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      Dim DDRoleGroups As DropDownList
      DDRoleGroups = FormView1.FindControl("DDRoleGroup")
  End Sub
  </code></pre>
  
  <p>Here's the FormView: <em>(I took out most of the fields so it's easier to read)</em></p>
  
  <pre><code>&lt;asp:FormView ID="FormView1" runat="server" DataKeyNames="ID" 
       DataSourceID="ObjectDataSource_Vendors" 
       DefaultMode="Insert" BorderColor="DarkGray" 
       BorderStyle="Solid" BorderWidth="1px" CellPadding="4" Visible="False"&gt; 
    &lt;EditItemTemplate&gt; 
    &lt;/EditItemTemplate&gt; 
    &lt;InsertItemTemplate&gt;                          
      &lt;label class="form_label"&gt;Role Group:&lt;/label&gt;&lt;br /&gt;&lt;asp:DropDownList ID="DDRoleGroup" 
                 runat="server" Width="175px"
                 EnableViewState="False"&gt; 
                &lt;/asp:DropDownList&gt;
     &lt;/InsertItemTemplate&gt;
  &lt;/asp:FormView&gt;
  </code></pre>
  
  <p>Could it possibly have to do with the fact that it's in the Page_Load sub and the control hasn't acctually loaded yet?</p>
  
  <p>Thanks,<br/>
  Matt</p>