title: Why can't get the right value of dropdownlist in asp.net
body: <p>I have following codes in asp.net:</p>
  
  <pre><code>&lt;asp:dropdownlist id="ddlApp" runat="server" /&gt;
  &lt;asp:button id="btnSmt" runat="server" Text="Submit" /&gt;
  </code></pre>
  
  <p>and code behind:</p>
  
  <pre><code>    private void btnSmt_Click(object sender, System.EventArgs e)
      {
              lbl.Text = ddlApp.SelectedItem.Value;           
      }
  </code></pre>
  
  <p>The logic is very simple. Get the selected value of dropdownlist and pass it to lbl.text.</p>
  
  <p>But the problem is no matter how I try, the text show the fist value of list in the dropdownlist rather than the selected value.</p>
  
  <p>And I notice that everytime I click the button the page refresh.</p>
  
  <p>Please help.</p>
  
  <p>BTW, I have the following event binding:</p>
  
  <pre><code>private void InitializeComponent()
          {    
              this.btnSmt.Click += new System.EventHandler(this.btnSmt_Click);
              this.Load += new System.EventHandler(this.Page_Load);
              this.ddlApp.SelectedIndexChanged +=new System.EventHandler(this.ddlApp_Change);
  
          }
  </code></pre>