Beispiel #1
0
        protected void ddlLang_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlLang.SelectedValue == "ar-SA")
            {
                CommonMethods.AddCookie("Site_Language", ddlLang.SelectedValue, DateTime.Now.AddMonths(12));

                //Session["Site_Language"] = "ar-SA";
                //// btnLang.Text = "تغيير اللغة";
                //ddlLang.Items.Remove(new ListItem(Session["ddlSelectLang"].ToString(), "0"));

                //Session["ddlSelectLang"] = "الرجاء إختيار";
                //ddlLang.Items.Insert(0, new ListItem(Session["ddlSelectLang"].ToString(), "0"));
            }
            else if (ddlLang.SelectedValue == "en-US")
            {
                CommonMethods.AddCookie("Site_Language", ddlLang.SelectedValue, DateTime.Now.AddMonths(12));

                //Session["Site_Language"] = "en-US";
                //// btnLang.Text = "Change Language";
                ////ddlLang.Items.Remove("0");
                //ddlLang.Items.Remove(new ListItem(Session["ddlSelectLang"].ToString(), "0"));
                //Session["ddlSelectLang"] = "Select Lang please";
                //ddlLang.Items.Insert(0, new ListItem(Session["ddlSelectLang"].ToString(), "0"));
            }
            else if (ddlLang.SelectedValue == "ja-JP")
            {
                CommonMethods.AddCookie("Site_Language", ddlLang.SelectedValue, DateTime.Now.AddMonths(12));
            }

            else if (ddlLang.SelectedValue == "zh-TW")
            {
                CommonMethods.AddCookie("Site_Language", ddlLang.SelectedValue, DateTime.Now.AddMonths(12));
            }

            else if (ddlLang.SelectedValue == "fr-FR")
            {
                CommonMethods.AddCookie("Site_Language", ddlLang.SelectedValue, DateTime.Now.AddMonths(12));
            }

            Response.Redirect(Request.RawUrl);
        }