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
What is Post Cache substitution? The Post cache substitution is used when we want to cache the complete page but also require some of the dynamic region inside that cached page

Project Description: I need a simple app developed using C# or PHP which will talk to Tally ERP 9 using XML over HTTP. Only those who are well versed with Tally ERP 9 and its

Web Based Inventory Management System Project Description: I need a build in software which has the subsequent features, if anybody has ready to use web based application, pl

Which property on a Combo Box do you set with a column name, prior to setting the Data Source, to display data in the combo box? ComboBox.DataValueField = "ColumnName" When

Slide Bettween Window Application 1 Project Description: Like Mouse Gesture. Keep Right Mouse, Slide Left and drop right mouse. Move to earlier app on taskbar. Keep Lef

Mention different types of data providers available in .NET Framework. .NET Framework Data Provider for SQL Server - Give access to Microsoft SQL Server 7.0 or later version. I

I need a Custom Report - Crystal Reports Project Description: I am seeking a custom report for our syrinx hire software, all reports are made from Crystal Reports. Skills

Program of addition of byte type variables - C# Program Program of addition of byte type variables, i need program code for performing addition of byte type variables. Can any

What is the use of data adapter? The Data adapter are the objects that connect one or more Command objects to a Dataset object. They give logic that would get data from the dat

We need vb.net windows application programmer with min six years exp to work on our email marketing project Project Description: We need a windows application vb.net programm