Use of culture auto, DOT NET Programming

How can we use Culture Auto in project?

We will make a very simple login screen which we will try to use for English as well as the Greek.

The login screen will display English settings when an English user logs in and the Greek Settings when a Greek user logs in. So below are the some steps to start with.

883_Culture auto.png

Figure: - Culture Auto in action

In the figure above you can view the login page  i.e. the "LoginScreen.aspx". It is a simple page with 2 labels and 2 text boxes. The labels values i.e. the "User ID" and "Password" should be changed according to the regional settings set on the browser. So below are some of the steps for the same:-

1) Make 2 resource files as shown below one for Greece and other for the English. There are 3 values defined for "Userid", "Password" and the main title of the page. The One important thing to note is the naming convention of the files. You require tagging the naming convention with the language code. You can see from the figure below that the resource files naming convention is divided into 3 parts viz. Language code; File name & resource file extension. In the sample we will explain for the English & Greek language so I tagged the file with the "el" language code.

2360_Culture auto1.png

Figure: - Resource file naming conventions

Below are the 2 resource files defined :

401_Culture auto2.png

Figure: - Greek and English resource files

2) Once you have defined your resource files we require to define two attributes "UICulture=Auto" & "Culture=Auto". See the figure above "Culture Auto in Action".

3) The Final step you also require to define the resource key at the UI object level. You can see a sample of the similar in the figure "Culture Auto in Action".

1048_Culture auto3.png

Figure: - Login screen according to settings

Compile the project, run and see the output after changing the regional settings for both the languages. You must see different outputs as shown in the figure above. Without a single line of code everything works.... That is the magic of the "UICulture=Auto" attribute.

Posted Date: 9/25/2012 3:41:52 AM | Location : United States







Related Discussions:- Use of culture auto, Assignment Help, Ask Question on Use of culture auto, Get Answer, Expert's Help, Use of culture auto Discussions

Write discussion on Use of culture auto
Your posts are moderated
Related Questions
Media Player App Development for Windows 8.1 platform with outstanding UI, flexible controls and simple to use. The app should be consist of 1. Normal player controls 2. s

What is black box testing & White box testing? The Black box testing is also termed as functional testing. It ignores how the internal functionality of a system works & depends

Explain collation sequence in sql server. The Collation sequences are the set of rules which determine how the data is sorted and compared. The Sorting rules can be defined wit

What is a Metadata?  Metadata is information about a PE. In COM, metadata is communicated through non-standardized type libraries. In .NET, this data is contained in the header

How many types of assemblies are there? Private, Public/Shared, Satellite. A private assembly is normally used by a one application, and is stored in the application's director

Passport authentication A centralized service given by Microsoft, offers a single logon point for clients. Unauthenticated users are redirected to the Passport site

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

CTS(Common Type System) : In order that the two language communicate smoothly CLR has CTS (Common Type System). Example in VB you have "Integer" and in C++ you have "long" these d

how to access global resource file using javascript