ASP Drop Down List postback losing session state in Chrome and IE but firefox works perfect
<p>I have a ddl on my master page that is set to auto postback to retrieve data based on their selection. The values in the list are customerids and they have been setup as a session variable and once someone has selected which one, the code looks at session["selectedCustomer"] and populates the appropriate fields. Now the problem that I have run into, is when the auto postback goes through on Chrome or IE, it populates the fields and then the selected customer is set back to default which is "Please select customer" which has no value behind it. In firefox after the postback it populates the fields and then the drop down list stays on the selected customer.</p>

<pre><code>    protected void ddlSelectedCustomer_SelectedIndexChanged(object sender, EventArgs e)
    {
        CustomerSelected();

        Response.AppendHeader("Refresh", "0; URL=" + this.ResolveUrl("~/AcesSetup/storefront.aspx"));
        try
        {
            ViewState["SelectedAccordionIndex"] = ((AjaxControlToolkit.Accordion)FindControl("MyAccordion")).SelectedIndex;
        }
        catch (Exception ex)
        { }
    }
</code></pre>

<p>That is the selectedChanged event for my ddl</p>

<pre><code>    private void CustomerSelected()
    {

        //clear the session variable
        Session.Remove("selectedCustomer");

        //user selected customer
        if (ddlSelectedCustomer.SelectedIndex != -1)
        {
            Session["selectedCustomer"] = ddlSelectedCustomer.SelectedValue;
        }

    }

    private void fillCustomers()
    {

        //save the value of the current selection to reselect later if still exists
        string origSelectedItem = ddlSelectedCustomer.SelectedValue;

        //check what role the user is in
        string usersRole = Roles.GetRolesForUser(Membership.GetUser().UserName)[0];

        MembershipUser user = Membership.GetUser();

        switch (usersRole)
        {
            case "SalesRep":
                ddlSelectedCustomer.DataSource = DAL.Util.getSalesRepCustomers((Guid)user.ProviderUserKey);
                ddlSelectedCustomer.DataBind();

                break;
            case "BasicUser":
            case "Customer":
                ddlSelectedCustomer.DataSource = DAL.Util.getCustomersListForUser((Guid)user.ProviderUserKey);
                ddlSelectedCustomer.DataBind();

                break;
            case "Admin":
            case "SuperAdmin":
                ddlSelectedCustomer.DataSource = DAL.Util.getAllCustomersList(); 
                ddlSelectedCustomer.DataBind();
                break;
            default:
                break;
        }

        //if user had a company selected, reselect it if it exists
        if (origSelectedItem != string.Empty)
            ddlSelectedCustomer.SelectedValue = origSelectedItem;
        else if (ddlSelectedCustomer.Items.Count == 1)
        {
            //if only one item in the list, select it
            ddlSelectedCustomer.Items[0].Selected = true;
        }
</code></pre>

<p>This what populates the drop down list. Also when Firefox does the post back the whole page does not appear to reload, with Chrome or IE the whole page will flash white and reload.. That to me seems like it has something to do with it. Because with Firefox the viewstate I have for my accordion works like it is supposed to, but again not with Chrome or IE.</p>

<p>If you have any help I would appreciate it, if there is anything I can clear up, or any code snipets I could provide I will do my best to update everything.</p>

<p>Thank you.</p>
