title: How to Get Selected Value from Dropdown List C# ASP.NET
body: <p>i have created simple website asp.net webform using C#. i have code to display data in dropdownlist when page load like this:</p>
  
  <pre><code>private void DisplayData()
  {
      List&lt;ListItem&gt; items = new List&lt;ListItem&gt;();
      items.Add(new ListItem("User", "1"));
      items.Add(new ListItem("Administrator", "0"));
      DropdownList1.DataSource = items;
      DropdownList1.DataBind();
  }
  </code></pre>
  
  <p>I call it in page load:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (!IsPostBack)
      {
          DisplayData()
      } 
  }
  </code></pre>
  
  <p>i try to get value from <strong>DropdownList1</strong> in btnSubmit</p>
  
  <pre><code>protected void btnSubmit_Click(object sender, EventArgs e)
  {
      lblResult.Text = DropdownList1.SelectedValue;
  }
  </code></pre>
  
  <p>this result always get value <strong>User</strong> or <strong>Administartor</strong> string. but, it doesn't i want. I wanna get value just from the values in DropdownList1 as <strong>0</strong> or <strong>1</strong>. How to do this?</p>