title: Get selected value from drop down inside GridView on Update
body: <p>So I have some GridView. When you edit a row, a particular column changes from a label to a DropDownList. The content of this drop down is populated via some SQL data source.
  The user may make a selection choice and click "Update".</p>
  
  <p>How can I actually get at the SelectedValue property of the drop down?</p>
  
  <p>I thought this would work:</p>
  
  <pre><code>    &lt;asp:GridView ... &gt;
          &lt;Columns&gt;
              ...
                  &lt;EditItemTemplate&gt;
                      &lt;asp:DropDownList ID="ServiceCategoriesGvDropDown" AutoPostBack="True" .../&gt;
                  &lt;/EditItemTemplate&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ... /&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
              ...
          &lt;/Columns&gt;
      &lt;/asp:GridView&gt;   
  </code></pre>
  
  <p>And then wire it up with a ControlParameter in my SqlDataSource:</p>
  
  <pre><code>    &lt;UpdateParameters&gt;
          ...
          &lt;asp:ControlParameter ControlID="ServiceCategoriesGvDropDown" PropertyName="SelectedValue" ... /&gt;
      &lt;/UpdateParameters&gt;
  </code></pre>
  
  <p>However, I get the following exception:</p>
  
  <p>System.InvalidOperationException: Could not find control 'ServiceCategoriesGvDropDown' in ControlParameter 'ServiceCategoriesID'.</p>
  
  <p>So clearly my drop down doesn't get found. Perhaps it's been destroyed by this point?</p>