Strange behavior of dropdownlist selected values
<p>I am populating a DDL with another DDL and i am getting the value from another page`</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        DropDownList1.DataSource = ProfileMasterDAL.bindcountry();
        DropDownList1.DataBind();
        DropDownList1.Items.Insert(0, "--Select country--");

    }


    if(Session["uname"]!=null)
    {
          DropDownList1.SelectedValue = Session["country"].ToString();
       ProfileMasterBLL bll=new ProfileMasterBLL();
        foreach (var VARIABLE in ProfileMasterDAL.bindcountry())
        {
            if (VARIABLE.ToString().Contains(DropDownList1.SelectedItem.Text))
            {
                var query = (ProfileMasterDAL.GetStatesByCountrys(DropDownList1.SelectedItem.Text));
                DropDownList2.DataSource = query;
                DropDownList2.DataBind();
             }
        }




        DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByText(DropDownList1.SelectedItem.Text));

      DropDownList1.Items.FindByText(DropDownList1.SelectedItem.Text).Selected = true;
        string str = DropDownList1.SelectedItem.Value;

        DropDownList1.Items.FindByText(DropDownList1.SelectedItem.Text).Selected = true;

      var states = (new ProfileMasterDAL()).GetStatesByCountry(str);
      DropDownList2.Enabled = true;
        DropDownList2.Items.Clear();
        DropDownList2.DataSource = states;
        DropDownList2.DataBind();

    }



  &lt;countrys&gt;
  &lt;country&gt;
    &lt;name&gt;India&lt;/name&gt;
    &lt;state&gt;
      &lt;text&gt;Maharashtra&lt;/text&gt;
      &lt;text&gt;Kashmir&lt;/text&gt;
      &lt;text&gt;Goa&lt;/text&gt;
    &lt;/state&gt;
  &lt;/country&gt;
  &lt;country&gt;
    &lt;name&gt;Sri lanka&lt;/name&gt;
    &lt;state&gt;
      &lt;text&gt;Kanady&lt;/text&gt;
      &lt;text&gt;Colombo&lt;/text&gt;
      &lt;text&gt;Galle&lt;/text&gt;
    &lt;/state&gt;
  &lt;/country&gt;
  &lt;country&gt;
    &lt;name&gt; Australia&lt;/name&gt;
    &lt;state&gt;
      &lt;text&gt;Sydney&lt;/text&gt;
      &lt;text&gt;Perth&lt;/text&gt;
      &lt;text&gt;Melbourne&lt;/text&gt;
    &lt;/state&gt;
  &lt;/country&gt;
  &lt;country&gt;
    &lt;name&gt;South Africa&lt;/name&gt;
    &lt;state&gt;
      &lt;text&gt;Capetown&lt;/text&gt;
      &lt;text&gt;Johanusburg&lt;/text&gt;
      &lt;text&gt;Durban&lt;/text&gt;
    &lt;/state&gt;
  &lt;/country&gt;
  &lt;country&gt;
    &lt;name&gt;USA&lt;/name&gt;
    &lt;state&gt;
      &lt;text&gt;Alabama&lt;/text&gt;
      &lt;text&gt;California&lt;/text&gt;
      &lt;text&gt;Detroit&lt;/text&gt;
    &lt;/state&gt;
  &lt;/country&gt;
  &lt;country&gt;
    &lt;name&gt;UK&lt;/name&gt;
    &lt;state&gt;
      &lt;text&gt;London&lt;/text&gt;
      &lt;text&gt;Paris&lt;/text&gt;
      &lt;text&gt;Italy&lt;/text&gt;
    &lt;/state&gt;
  &lt;/country&gt;
&lt;/countrys&gt;
</code></pre>

<p>The weird problem is that if i select the DDL to some other country say UK or USA the DropDownList1.SelectedItem.Text value remains south africa(the value from the session) and if i select the countries above south africa states DDL is populating i dont what is the reason behind it?any solution or suggestions for it?</p>

<pre><code>f (!IsPostBack)
        {
            DropDownList1.DataSource = ProfileMasterDAL.bindcountry();
            DropDownList1.DataBind();
            DropDownList1.Items.Insert(0, "--Select a country--");

        }
</code></pre>
