title: Populated Dropdownlist not working properly
body: <p>Here ext is storing "System.Web.UI.WebControls.Label" but i want to retrieve the selected text in dropdownlist. What's the problem here?
  I am populating dropdownlist2 based on dropdownlist1. please refer to below code.</p>
  
  <pre><code>    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
  {
      a = DropDownList1.SelectedItem.Text;
      DropDownList2.Items.Clear();
      if (a == "Electronic")
      {
          DropDownList2.Items.Add(new ListItem("---Select SubCategory---","0"));
          DropDownList2.Items.Add(new ListItem("Mobile", "1"));
          DropDownList2.Items.Add(new ListItem("Tablet", "2"));
          DropDownList2.Items.Add(new ListItem("Laptop", "3"));
          DropDownList2.Items.Add(new ListItem("Accessories", "4"));
      }
      else if (a == "Kitchen")
      {
          DropDownList2.Items.Add(new ListItem("---Select SubCategory---", "0"));
          DropDownList2.Items.Add(new ListItem("Cookware", "1"));
          DropDownList2.Items.Add(new ListItem("Dinner set", "2"));
          DropDownList2.Items.Add(new ListItem("Food processor", "3"));
          DropDownList2.Items.Add(new ListItem("Microwave", "4"));
  
      }
      else if (a == "Books")
      {
          DropDownList2.Items.Add(new ListItem("---Select SubCategory---", "0"));
          DropDownList2.Items.Add(new ListItem("Entrance exam", "1"));
          DropDownList2.Items.Add(new ListItem("Fiction", "2"));
          DropDownList2.Items.Add(new ListItem("Romance", "3"));
          DropDownList2.Items.Add(new ListItem("Thriller", "4"));
  
      }
      else if (a == "Beauty")
      {
          DropDownList2.Items.Add(new ListItem("---Select SubCategory---", "0"));
          DropDownList2.Items.Add(new ListItem("Mens perfume", "1"));
          DropDownList2.Items.Add(new ListItem("Womens perfume", "2"));
      }
        string ext = DropDownList2.SelectedItem.Text;
  }
  </code></pre>
  
  <p><strong>Edit:</strong></p>
  
  <blockquote>
    <p>Problem here is that I am using validation &amp; it must not allow submission if I press submit button. But I have more 4 buttons for navigation purpose and that validation is not allowing me to use these buttons i.e it should allow me to execute code of button2_click and not allow for submit_click.</p>
  </blockquote>