Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Threading;
using System.Globalization;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            InitializeCulture();
        }
    }
    protected override void InitializeCulture()
    {
        if (Session["Drop"] == "ar-SA")
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("ar-SA");
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("ar-SA");
        }
        else if (Session["Drop"] == "en-US")
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
        }
        else
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");       
        }
        base.InitializeCulture();
    }

    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        Session["Drop"] = DropDownList1.SelectedValue;
        Response.Redirect("Default.aspx");
    }
}
.
Posted
Comments
OriginalGriff 23-Feb-14 3:59am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.

1 solution

HTML
Response.Redirect("Default.aspx");

That line will make it a full post every time!!!
Why you put it there at the first place?!
You need not that line!!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900