using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Threading; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Configuration; 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") { // string str = Session["Drop"].ToString(); 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"); } base.InitializeCulture(); } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { Session["Drop"] = DropDownList1.SelectedValue; Response.Redirect("Default.aspx"); } }
<pre lang="cs"> ... your code sample ... </pre>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)