title: Text from selected item in DropDownList asp.net
body: <p>In the pageload i populate a dropdownlist like this:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
      {
          string buildingTypeSoldier = "soldier";
          var soldierBuilding = from b in dc.Buildings
                                   where b.buildingtype == buildingTypeSoldier
                                   select b.buildingname;
          ddlSoldierBuildings.DataSource =soldierBuilding;
          ddlSoldierBuildings.DataBind();
      }
  </code></pre>
  
  <p>But when i then try to set the text of a label on the same page to the selectetitem.text i only get the first item in the list, not the item i selected. I try to set the text by using a button like this:</p>
  
  <pre><code>protected void btnBuySoldierBuilding_Click(object sender, EventArgs e)
      {
          lblTestlabel.Text = ddlSoldierBuildings.SelectedItem.Text;
      }
  </code></pre>
  
  <p>the dropdownlist contains tree items, barracks, shooters range, and stable which i get from my database. Does the page load overwrite my selection when i click the button? How can i solve this?</p>