title: DropDownList Control asp.net SelectedValue
body: <p>I am Working With DropdownList Control ... First I bind the dropdown Control  <br>in Page_Load() using this Code <br></p>
  
  <pre><code>   combo.DataSource = ds3.Tables[0];//combo is the ID of DropDownList Control
              combo.DataTextField = ds3.Tables[0].Columns["ProjectName"].ColumnName.ToString();
              combo.DataValueField = ds3.Tables[0].Columns["ID"].ColumnName.ToString();
              combo.DataBind();
  </code></pre>
  
  <p>then I use the selected Value in Button click  using this Code  <br></p>
  
  <pre><code>   protected void btn_newUser_Click(object sender, EventArgs e)
      {
  
  
      cmd1 = new SqlCommand("SP_createUserFroProjects", con);
      cmd1.CommandType = CommandType.StoredProcedure;
      int m =Convert.ToInt32( combo.SelectedValue);
      cmd1.Parameters.AddWithValue("@projectID",m);
      cmd1.Parameters.AddWithValue("@userName", txt_User.Text);
      cmd1.Parameters.AddWithValue("@password", txt_pass.Text);
      cmd1.Parameters.AddWithValue("@name", txt_User_Name.Text);
  
      ds4 = new DataSet();
      adpt4 = new SqlDataAdapter(cmd1);
      adpt4.Fill(ds4);
  </code></pre>
  
  <p>When I check the result int m  is always equal to 1 in the inspect of the page the html is </p>
  
  <pre><code>&lt;select name="combo" id="combo"&gt;
      &lt;option selected="selected" value="1"&gt;project1&lt;/option&gt;
      &lt;option value="2"&gt;project2&lt;/option&gt;
      &lt;option value="3"&gt;project3 &lt;/option&gt;
      &lt;option value="4"&gt;project4 &lt;/option&gt;
      &lt;option value="5"&gt;lubdbsljv&lt;/option&gt;
      &lt;option value="10"&gt;project5&lt;/option&gt;
      &lt;option value="1018"&gt;test4&lt;/option&gt;
      &lt;option value="1019"&gt;test5 &lt;/option&gt;
      &lt;option value="1020"&gt;test6&lt;/option&gt;
      &lt;option value="1021"&gt;test7&lt;/option&gt;
      &lt;option value="1022"&gt;testtt&lt;/option&gt;
      &lt;option value="1023"&gt;new&lt;/option&gt;
      &lt;option value="1024"&gt;new2&lt;/option&gt;
      &lt;option value="1025"&gt;new5&lt;/option&gt;
      &lt;option value="1026"&gt;next&lt;/option&gt;
      &lt;option value="1027"&gt;new nnn&lt;/option&gt;
      &lt;option value="1028"&gt;ttttt&lt;/option&gt;
      &lt;option value="1029"&gt;new project 5 &lt;/option&gt;
      &lt;option value="1030"&gt;newprj&lt;/option&gt;
      &lt;option value="1031"&gt;projectnewtest&lt;/option&gt;
  
  &lt;/select&gt;
  </code></pre>
  
  <p>but it always sends first Value from selected value in the button click </p>