title: .net dropDownList losing value after postback in IE
body: <p>I have a problem with the selected value of a dropDown.</p>
  
  <p>The code working perfectly fine, except when I change the IE compatibility mode, the drop down don't keep the selected value and come back to the first item and i can't make it work anymore.</p>
  
  <p>When I change something on the server, files or configuration in IIS, everything is working fine until I Change de compatibility mode again.</p>
  
  <p>I've tried putting the selected value in the session to keep it but it's not working. I really tried everything, thanks in advance.</p>
  
  <p>here's the asp code : </p>
  
  <pre><code>  &lt;asp:DropDownList ID="ddlFiltre" runat="server" AutoPostBack="True" EnableViewState="true" Width="100%" OnSelectedIndexChanged="ddlFiltre_SelectedIndexChanged"&gt;
                  &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>Here's the code behind: </p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
    }
  protected void Page_PreRender(object sender, EventArgs e)
  {
      if (!Page.IsPostBack)
      {
          ddlFiltre.Items.Clear();
          ddlFiltre.Items.Add(new ListItem(GetLibelle("item1"), "-1"));
          ddlFiltre.Items.Add(new ListItem(GetLibelle("item2"), "0"));
          ddlFiltre.Items.Add(new ListItem(GetLibelle("item3"), "1"));
          ddlFiltre.Items.Add(new ListItem(GetLibelle("item4"), "2"));
          GetPermission();
  
      }
      else
      {
  
          ddlFiltre.SelectedValue = Session["ddl_index"].ToString();
      }
  
  
  
      LoadPageControls();
  
  
  }
  
  
  
  private void GetPermission()
  {
  
  }
  
  private void LoadPageControls()
  {
      if (LoggedUser != null)
      {
  
  
          if (ddlFiltre.SelectedValue == "-1")
          {
              // Load info in table
          }
          else
          {
              // Load other info in table
          }
  
  
  
      }
  }
  
  
  protected void ddlFiltre_SelectedIndexChanged(object sender, EventArgs e)
  {
      Session["ddl_index"] = ddlFiltre.SelectedValue;
  }
  </code></pre>