locked
Globalization and Localization RRS feed

  • Question

  • User560349940 posted

    how to apply resource files to my website , what is the use global resource file and local resource file, how to coonect to webpage to resource files , Please tell me that the procedure they work with website and how it is work 

    Monday, August 27, 2012 5:49 PM

Answers

  • User1410261963 posted

    hello,

    Try to write this

    using System.Globalization; 
    using System.Threading; 
     
    public partial class _Default : System.Web.UI.Page 
    { 
        protected override void InitializeCulture() 
        { 
            base.InitializeCulture(); 
            if (Request.QueryString["Language"] != null) 
            { 
                Thread.CurrentThread.CurrentCulture = new CultureInfo(Request.QueryString["Language"]); 
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(Request.QueryString["Language"]); 
            } 
        } 
        protected void Page_Load(object sender, EventArgs e) 
        { 
     
        } 
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) 
        { 
            if (DropDownList1.SelectedIndex !=0) 
            { 
                //here SelectedValue as a pattern such as ar-EG or en-US 
                Response.Redirect(Request.Path+"?Language="+DropDownList1.SelectedValue); 
            } 
        } 
        protected void LinkButton1_Click(object sender, EventArgs e) 
        { 
            Response.Redirect("~/Login.aspx?Language=" + Request.QueryString["Language"]); 
        } 
    }

    for more info follow these links

    http://www.codeproject.com/Articles/14818/ASP-NET-2-0-Globalization-Localization-solution

    http://www.codeproject.com/Articles/325222/Globalization-and-Localization-in-ASP-Net-web-appl

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 27, 2012 5:52 PM