title: Populating Two Dropdownlist on PageLoad
body: <p>I have two Dropdownlist in my one webpage. The second one relies on first one to load.
  For instance, if first one is "Melbourne", second one list all the suburbs of melbourne.</p>
  
  <p>Code is perfectly working but when i first load the page, the second dropdownlist2 doesn't populate.
  I need to select "Melbourne" again to populate second Dropdownlist.</p>
  
  <p>Here is my code for Page load</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (!Page.IsPostBack)
      {
          if (Session["Username"] == null)
          {
              Response.Redirect("LoginPage.aspx");
          }
  
          if (getAccess(Session["Username"].ToString()) == false)
          {
              Response.Redirect("Unauthorized.aspx");
          }
  
          DataSet ds = GetAllCategory();
          if (ds.Tables.Count &gt; 0)
          {
              DropDownList1.DataTextField = "identifier";
              DropDownList1.DataValueField = "OS_ID"; //Change field to one you want.
              DropDownList1.DataSource = ds.Tables[0];
              DropDownList1.DataBind();
          }
      }
  }
  </code></pre>
  
  <p>And here is the Selected Index Changed code</p>
  
  <pre><code> protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
  {
      DataSet ds = softwareType(Convert.ToInt32(DropDownList1.SelectedValue));
      if (ds.Tables.Count &gt; 0)
      {
          DropDownList2.DataTextField = "identifier";
          DropDownList2.DataValueField = "ST_ID"; //Change field to one you want.
          DropDownList2.DataSource = ds.Tables[0];
          DropDownList2.DataBind();
      }
  }
  </code></pre>
  
  <p>I am not sure how to fix this simple issue?</p>