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 are the different accessibility levels in .NET? The five levels of access modifiers are as follows:- Private: The members of the class only have the access.

Fixing chrome problem Problem 1- Booksearcha.asp and bookrstep2.asp on allreaders.com (bookrstep2 only accessible from bookrstep1.asp) utilize scroll down menus at times. In Chr

What is different overloading and overriding, please explain

Project Description: We have a classic VC++ Dll (source code of DLL not available) that requires a .NET wrapper built by you. Use latest Visual Studio and.Net framework should b

What is serialization, how it works in .NET? Serialization is when you persist the state of an object to a storage medium so an exact copy can be re-created at a later stage. S

They are triggered in the following order as shown below: Application_BeginRequest Application_AuthenticateRequest Application_AuthorizeRequest Application_ResolveReque

Program of Declaring a function - C# Program Program of Declaring a function, I am looking for a program in C#. It would be great if anyone help me learn function in C# langua

What is the difference between OLEDB Provider and SqlClient? With respect to usage, there is no difference among OLEDB Provider and SqlClient. The dissimilarity lies in their p

Data hiding and encryption would be done on images. Both these process should have a data hiding key and an encryption key correspondingly. Another user should be able to decrypt t

Encripter-Decripter application Project Description: I want an application which can encrypt - decrypt text, images, and music files as well as videos. Skills required are