Scenarios

In this article I will guide you how to implement Multi-language into an Asp.net website using C# and App_GlobalResources files.

Step 1: Create new a website project (I’m using VS2012 in this demo)

Step 2: Once your project created you need to add App_GlobalResources folder to your project.

This is an easy action. To create the folder, in Solution Explorer, just right-click the name of your Web site, click Add Folder, and then click App_GlobalResources folder. There can only be one of these folders in an application, and it must be located at the root of the application.

Step 3: After that, right-click on App_GlobalRrsources folder and select Resources File to create new files for additional languages. You can define the name for language files as the pattern “name.language-culture.resx”. In this demo I will define two files name as chienvh.language.resx (English) and chienvh.language.vi-vn.resx (Vietnamese).

Step 4: Open two resource files to define the name and value (notice leaving the names as a keys as the same in those files)

Step 5: Create new a class file with the name as BasePage.

In this file you will do the work to initialize the Culture, and then, hence, when you creating a new webpage then in the code-behind of that file you need to inherit from BasePage instead of default option as System.Web.UI.Page

Your code is really help me so much. And I just 1 2 move Overrides Sub InitializeCulture() in MasterPage but it got an error "sub 'InitializeCulture' cannot be declared 'Overrides' because it does not override a sub in a base class."

This really helped me understand the concept.
I tried this in Visual Studio 2010 but it is giving error.
"Could not load file or assembly 'ASPNetMultiLanguage' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."