articles

Home / DeveloperSection / Articles / ASP.Net Globalization

ASP.Net Globalization

mohan kumar7339 21-Nov-2011

Hey Guys!! In this tutorial, I am going to explain you the concept of Globalization with an Example.

Globalization: - Process of creating an application that meets the needs of users from multiple cultures. This process involves more than just translating the user interface of an application into multiple languages – it also includes using the correct currency, date and time format, calendar, writing direction and other issues.

Default.aspx:-
<form id="form1" runat="server">
    <div>
    <asp:Label ID="lblCulture" runat="server" ></asp:Label>
    </div>
</form>

Default.aspx.cs:-

Don’t forget to add the namespace System.Globalization. Use VB Or C# use this lines to add the namespace.

Using System.Globalization; (C#)

Import System.Globalization; (VB)

In your Page_Load event,add the below lines:-

protected void Page_Load(object sender, EventArgs e)
    {
        string sLang =Request.UserLanguages[0];
        CultureInfo currentCulture= new CultureInfo(sLang);
  lblCulture.Text = currentCulture.EnglishName + ":" + currentCulture.Name.ToLower();
    } 

Your output will be similar to this:-

ASP.Net Globalization

 

Just post back a reply if this article was useful for you. Thanks for reading my article. Happy Coding.Explore more and more as much as possible.


Updated 04-Mar-2020
Having around 5 Years experience in .NET domain.

Leave Comment

Comments

Liked By