title: Dropdown reverting to index on postback
body: <p>so here, im using asp.net and vb as my code behind. so here is the catch, im dynamically cascading all of my values accordingly to the value of another dropdown just as cascading dropdown with ajax did. but the problem is 1 of my dropdown is reverting its index to 1 while the other dropdown is fixed with their selected value.</p>
  
  <p>i have a feeling that this was caused by databinding of values to this dropdown.</p>
  
  <p>below is my html markup and vb codebehind</p>
  
  <pre><code>    Agency&lt;asp:DropDownList ID="DDLAgency" runat="server" AutoPostBack="true" OnSelectedIndexChanged="agen_choose" &gt;
   &lt;asp:ListItem Text="Agency"&gt;&lt;/asp:ListItem&gt;
   &lt;/asp:DropDownList&gt;
   &lt;br /&gt;
   Advertiser&lt;asp:DropDownList ID="DDLAdvert" runat="server" AutoPostBack="true" OnSelectedIndexChanged = "adver_choose" &gt;
   &lt;asp:ListItem Text="Advertiser" &gt;&lt;/asp:ListItem&gt;
   &lt;/asp:DropDownList&gt;
   &lt;br /&gt;
   Product    &lt;asp:DropDownList ID="DDLProd" runat="server" AutoPostBack="true" OnSelectedIndexChanged="get_prod_version" OnDataBinding="lem"&gt;
       &lt;asp:ListItem Text="Product"&gt;&lt;/asp:ListItem&gt;
       &lt;/asp:DropDownList&gt;
       &lt;br /&gt;
   Version and Length &lt;asp:DropDownList ID="DDlVer" runat="server"&gt;
                       &lt;asp:ListItem Text="Version"&gt;&lt;/asp:ListItem&gt;
                                            &lt;/asp:DropDownList&gt;   
      &lt;br /&gt;
  Program      &lt;asp:DropDownList ID="DDLProg" runat="server" &gt; 
  &lt;asp:ListItem Text="Program"&gt;&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt;     
  &lt;br /&gt;
  </code></pre>
  
  <p>here is the vb codebehind</p>
  
  <pre><code>Protected Sub get_prod_version()
          Dim conn As New SqlConnection(Session("cs").ToString)
          Select Case Session("platform").ToString
              Case "A"
                  Dim que1 As String = "select v_version +' Lenght:' + convert(varchar(10), v_spotlen) as 'Version And Lenght', v_vpcode from tb.tbl where v_vpcode = (select p_pcode from sysadm.product where p_pcode='" &amp; DDLProd.SelectedValue &amp; "')"
                  Dim cmd4 As New SqlCommand(que1, conn)
                  conn.Open()
                  DDlVer.DataSource = cmd4.ExecuteReader
                  DDlVer.DataTextField = "Version And Lenght"
                  DDlVer.DataValueField = "v_vpcode"
                  DDlVer.DataBind()
                  conn.Close()
                  DDlVer.Items.Add("Version")
                  '--
              Case "B"
                  Dim que1 As String = "select v_version +' Lenght:' + convert(varchar(10), v_spotlen) as 'Version And Lenght', v_vpcode from tb.tbl where v_vpcode = (select p_pcode from sysadm.product where p_pcode='" &amp; DDLProd.SelectedValue &amp; "')"
                  Dim cmd4 As New SqlCommand(que1, conn)
                  conn.Open()
                  DDlVer.DataSource = cmd4.ExecuteReader
                  DDlVer.DataTextField = "Version And Lenght"
                  DDlVer.DataValueField = "v_vpcode"
                  DDlVer.DataBind()
                  conn.Close()
  
                  DDlVer.Items.Add("Version")
                  '--
              Case "C"
                  Dim que1 As String = "select v_version +' Lenght:' + convert(varchar(10), v_spotlen) as 'Version And Lenght', v_vpcode from tb.tbl where v_vpcode = (select p_pcode from QTVSA.product where p_pcode='" &amp; DDLProd.SelectedValue &amp; "')"
                  Dim cmd4 As New SqlCommand(que1, conn)
                  conn.Open()
                  DDlVer.DataSource = cmd4.ExecuteReader
                  DDlVer.DataTextField = "Version And Lenght"
                  DDlVer.DataValueField = "v_vpcode"
                  DDlVer.DataBind()
                  conn.Close()
                  '--
                  DDlVer.Items.Add("Version")
              Case "D"
                  Dim que1 As String = "select v_version +' Lenght:' + convert(varchar(10), v_spotlen) as 'Version And Lenght', v_vpcode from tb.tbl where v_vpcode = (select p_pcode from SYSADM.product where p_pcode='" &amp; DDLProd.SelectedValue &amp; "')"
                  Dim cmd4 As New SqlCommand(que1, conn)
                  conn.Open()
                  DDlVer.DataSource = cmd4.ExecuteReader
                  DDlVer.DataTextField = "Version And Lenght"
                  DDlVer.DataValueField = "v_vpcode"
                  DDlVer.DataBind()
                  conn.Close()
                  '--
                  DDlVer.Items.Add("Version")
              Case "E"
                  Dim que11 As String = "select v_version +' Lenght:' + convert(varchar(10), v_spotlen) as 'Version And Lenght', v_vpcode from tb.tbl where v_vpcode = (select p_pcode from QTVSA.product where p_pcode='" &amp; DDLProd.SelectedValue &amp; "')"
                  Dim cmd41 As New SqlCommand(que11, conn)
                  conn.Open()
                  DDlVer.DataSource = cmd41.ExecuteReader
                  DDlVer.DataTextField = "Version And Lenght"
                  DDlVer.DataValueField = "v_vpcode"
                  DDlVer.DataBind()
                  conn.Close()
                  '--
                  DDlVer.Items.Add("Version")
          End Select
      End Sub
  </code></pre>