title: Repopulate Dropdown on Button Click
body: <p>I have a DataBound DropDown control (so it's populated by a query specified in the designer) and I'd like this query to be repopulated when a button is clicked. The DropDown is defined as follows:</p>
  
  <pre><code>&lt;asp:DropDownList ID="JobRelPhase_DropDown" runat="server" 
       DataSourceID="SqlDataSourceMYDATASOURCE" DataTextField="JobRelPhase" 
       DataValueField="id" OnSelectedIndexChanged="my_DropDown_SelectedIndexChanged" 
       AutoPostBack="True" style="text-align: center" 
       Width="684px" Font-Bold="True" AppendDataBoundItems="true" BackColor="White" 
       ForeColor="Black"&gt;
           &lt;asp:ListItem Value="SELECT AN ITEM" disabled="disabled"&gt;&lt;/asp:ListItem&gt;
  &lt;/asp:DropDownList&gt;`
  </code></pre>
  
  <p>and the query is defined in <code>SqlDataSourceMYDATASOURCE</code>.</p>
  
  <p>EDIT: Here is the function that is called when the button is clicked:</p>
  
  <pre><code>protected void GenerateButton_Click(object sender, EventArgs e)
  {
      if (JobRelPhase_DropDown.SelectedIndex != -1)
      {
          if (JobActive())
          {
              SetButton(GenerateButton, false);
              //JobRelPhase_DropDown.SelectedIndex = -1; //to set back to the top of the list
              JobRelPhase_DropDown.DataBind();
          }
      }
  }
  </code></pre>