title: Get selected value from a dropdownlist asp.net
body: <p>I know this is a silly question but i can't find out how to get the selected value from my dropdownlist :(</p>
  
  <p>Init the dropdownlist:</p>
  
  <pre><code>             SqlCommand command = new SqlCommand("SelectAllUserID", connection);
               command.CommandType = CommandType.StoredProcedure;
  
              SqlDataReader sqlReader = command.ExecuteReader();
              if (sqlReader.HasRows)
              {
                  TProjectMID.DataSource = sqlReader;
                  TProjectMID.DataTextField = "UserID";
                  TProjectMID.DataValueField = "UserID";
                  TProjectMID.DataBind();
              }
  </code></pre>
  
  <p>Try to get the value of drop down list:</p>
  
  <pre><code>                String a;
                  a = TProjectMID.SelectedValue;
                  a = TProjectMID.SelectedItem.Value;
                  a = TProjectMID.DataValueField;
                  a = TProjectMID.Text;
  </code></pre>
  
  <p>It didn't return the value I chose, it keeps returning the default value when the dropdownlist appear ??</p>
  
  <p>Can anybody tell me what I did wrong ? Thank you </p>