Current culture of the environment in windows and asp.net, DOT NET Programming

How we get the current culture of the environment in windows and ASP.NET?

The "CultureInfo.CurrentCulture" represents the current culture of the environment. For illustrate if you are running Hindi it will show "hi-IN". Please note one thing in mind that "CurrentCulture" will only give you the culture on which your application is running.  If it is a windows application this will work great. But in ASP.NET 2.0 we need to know what culture the end user has.

For a real international website your different users can log in with different culture. For illustrate you can see from the given figure below different users are logging in with different regional settings. The Client browser sends the information in the request headers to the server. For illustrate a Korean user will send "KO" in the request headers to server. We can get the value by using the" Request.UserLanguages".

681_current culture.png

Figure: - Different users logging in from different countries

The Regional settings are defined on the user's browser as shown below. The Click on Tools - Internet options - Languages. You can also add languages in the language preference box. By Using "Move up" and "Move down" you may define the priority of the languages. In the figure below we have 4 languages defined with "Hindi" language set at the top priority. " The Request.UserLanguages" returns back an array of string with a sorted order defined in your language preference tab of the browser.

1598_current culture1.png

Figure: - Setting language preferences in browser

The code snippet below shows how we can display the user languages. The first figure is the code snippet which shows how to use the "Request.UserLanguages". The second figure represents the output for the same.

20_current culture2.png

Figure: - Request.UserLangauges in action

512_current culture3.png

Figure : - Output from request.Userlanguages

Posted Date: 9/25/2012 3:10:05 AM | Location : United States







Related Discussions:- Current culture of the environment in windows and asp.net, Assignment Help, Ask Question on Current culture of the environment in windows and asp.net, Get Answer, Expert's Help, Current culture of the environment in windows and asp.net Discussions

Write discussion on Current culture of the environment in windows and asp.net
Your posts are moderated
Related Questions
Printing Triangles - C# Program I need program code for Printing Triangles in C#. Can anybody send me there ideas?

How can we create custom controls in ASP.NET? The User controls are created using .ASCX in ASP.NET. After that .ASCX file is created you need two things in order to that the AS

25 16 25 9 16 25 4 9 16 25 1 4 9 16 25

I want Text/Image printing Counter Project Description: Need your help in our C# programming project. We need to pass this project in two weeks starting from now to pass our

What is the difference between the Select clause and SelectMany() method in LINQ? Both the Select clause and SelectMany() method are used to produce a result value from a sourc

Consuming a web service with SOAP on c# .NET Project Description: I need to consume a web service with SOAP. I have xml file and some description. I need it to be done

Project Description: We're seeking an IT candidate with experience to help us optimizely,  Skills required: .NET, C# Programming, ASP, eCommerce, SQL

What is LOCK escalation? The Lock escalation is the process of converting of the low level locks (such as row locks, page locks) into the higher level locks (such as table lock

What are indexes? The Indexes in the SQL Server are similar to the indexes in books. They help SQL Server to retrieve the data quickly.These are classified into clustered and n

What is DTD? The Document Type definition (DTD) defines how your XML should structure. For illustrate in the above XML we want to make it compulsory to provide "qty" and "total