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
Deat Sir/Madam, I need a small software .NET2.0 in C# That search for files by - name - extension - part of the name (contains) - file created before a date provided This search

What is the difference between thread and process?  Thread - is used to implement more than one program at a time. process - implements single program A thread is a path

Develop Targin protocol Project Description: We need to construct services in C# or VB.NET that will manipulate with a Targin TIP Protocol Server (protocol for financial info

Small website using ASP.NET MVC 4 EntityFramework 5 Project Description: We are seeking a developer to a ASP.NET MVC4 EntityFramework website using the subsequent tools: Visu

What is Service Oriented architecture? The "Services" are the components which expose well defined interfaces and these interfaces communicate through XML messages. By Using th

Hardware Monitor Tool in Visual Basic Project Description: Hi, seeking a developer who is experienced in Visual Basic 10 Or Visual Basic 13 and will develop an application li

What is nested Classes? You can access an array using the INDEX value of that array, but how many times you know the real value of the index. The Hashtable provides a way of ac

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

Explain Compare Validator and Range Validator Compare Validator uses Control To Validate, Control To Compare and operator properties to compare a control's value with another

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