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
TASK - DESIGN ALGORITHM You are required to design a suitable solution algorithm by using either structured chart, pseudocode or flowchart. This diagram should clarify the proce

Question: (a) One problem encountered when designing web applications is that HTTP is a "stateless" protocol. Explain two general approaches to solve the statelessness problem

Develop Skype Recorder Application + Setup + Sourcecode + NICE UI Project Description: i need an application built which will allow user to record skype audio or video calls

Why The JavaScript Validation Not Run on the Asp.Net? The Asp.Net Button Is post backed on the server & not yet Submit & when It goes to the server its states is lost so if we

We are seeking for online invoice OCR solution. That will help us to automate accounts payable function. User could be able to use the existing pdf file or scan a document, then

Is spending in projects constant throughout the project? Generally in initial stage of projects (design and requirement phase) the cost is very less (as you require maximum bus

What is strong-typing versus weak-typing? Which is preferred? Why? Strong type is checking the types of variables as soon as possible, usually at compile time. While weak typing

Hello, I want to develop one crystal report. I have one database which has 5 field.One is string and others are Boolean. String field name is State and Four remaining fields are Th

What are the different types of literals? A literal is a textual representation of an exacting value of a type. The dissimilar types of literals in Visual Basic are: Boo

i want to know how can i sum quantity column in gridview and place it in first row...not in footer..in .net. Rply ASAP