.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Localization in ASP.NET 2.0

Posted By: Syed Shakeer Hussain     Posted Date: July 14, 2010    Points: 2   Category :ASP.Net
New Auto-Culture Handling in ASP.NET 2.0
ASP.NET 2.0 comes with a new auto-culture handling feature to make the task of localizing your application easier. Auto-culture handling can be enabled for each page by including the Culture="auto" and UICulture="auto" attributes in the Page directive of each page. Once enabled, the ASP.NET runtime will automatically map Accept-Language headers to CultureInfo objects and attach them to the current thread (unlike ASP.NET 1.x, where you need to do this manually). As a developer, you simply need to prepare the resources for the different cultures you want to support in your application. ASP.NET will then do the work of loading the appropriate resources for each culture as they are needed.

Implicit Localization
Let's use Visual Studio 2005 and create a new website project by going to File -> "New Web Site.." Name the project C:\Localization. For this application, I will use the Visual Basic 2005 language.

View Complete Post

More Related Resource Links

SharePoint Localization Tips and Tricks

In this article, I'll round up the scattered pieces of information about localization in SharePoint, provide some tips and tricks and leave you with a working approach to localization. However, before we work on meeting the challenge, we should understand it.

How to: MVC URL localization...


Hello all,

I have an MVC 2.0 application which currently has 3 different languages.(English, French, Spanish).
Although I've found many articles on how to localize an etnire MVC application I still haven't found an example on how to localize the URLs.

Assuming I have the following English URL:

When I switch in either French or Spanish, I'd like to have the following:
French: http://www.mywebsite.com/Produit
Spanish: http://www.mywebsite.com/Producto

How does one achieve such a task?
If anyone cares to show me a link or demo, that would be great!

Thanks in advance!

Localization not working in class library (composite control)



I have a class library called WEM.portal which used Resource files to localise text in my composite controls.

I store my resource files (eg MyResourceFile1.resx) in App_GlobalResources folder and then refer to them using

MyLabel1.text = My.Resources.MyResourceFile1.MyResourceKey1

This is all working ok until I create seperate files for each language such as MyResourceFile1.FR-fr.resx.

I have implemented this throughout my other web applications but the Class Library doesnt seem to want to work the same way

When I load the page it correctly showes the resourced keys which I have done through the web application BUT the resource keys in the composite controls does not seem to pick up the culture code.

Am I missing something stupid. Ive tried

  • changing the Build Action on the resource file to Content and Custom tool to GlobalResourceProxyGenerator
  • Creating a resourceManager but to no avail


Language Localization



I want to make my website into world's different  laguages.Im very new to it .

plz help

Setting default localization



I ever thought that I can set a default localization if the users one (which is set in the browser) isn't available.

I've implemented my localresource files for localization. The start.aspx.resx contains all texts and elements for German use and the start.aspx.en.resx for English users. When I switch the language in the browser settings from German to English everything works fine and the english text is displayed. But when I switch to an other language which is not German or English, it takes defaulty the german resource files.

I've set

UICulture="auto:en-US" Culture="auto:en-US"

as well, but it didn't assume the .en resource file automatically. (For example when I enter the website and switch the browser language to French or Italian it should take the english resource files.)

Thanks and regards,

Globalization and Localization


How to maintaine a web application in different languages.

For Examplel(English, Chinees,German...)

Need any Detailed Example.

Basic Instincts: Resources and Localization in ASP.NET 2.0


In this installment of Advanced Basics Ted Pattison discusses the localization of Web sites in ASP.NET 2.0.

Ted Pattison

MSDN Magazine August 2006

Basic Instincts: Resources and Localization


There are two ways you can utilize resources such as strings, images, and text-based files from your Microsoft® . NET Framework-based application. You can embed them directly in the app or you can load them from an external file.

Ted Pattison

MSDN Magazine May 2006

.NET GUI Bliss: Streamline Your Code and Simplify Localization Using an XML-Based GUI Language Parse


While Windows Forms in .NET has lots of cool features, if you're used to MFC, there are a couple of things you'll find missing, like doc/view, command routing, and UI update. The .NET answer to this is a code generator that writes new code for every single element. But there's a better way. In this article, Paul DiLascia shows how to develop an XML-based GUI language parser for .NET that lets you code resources, menus, toolbars, and status bars in XML instead of with procedural code. He also shows how a user interface based on XML can easily be localized using standard .NET techniques, and introduces his very own library, MotLib.NET, with lots of GUI goodies for your programming pleasure.

Paul DiLascia

MSDN Magazine November 2002

Localization .RESX files - How to work with translators


I understand I need to place all the translated strings in .RESX files. How do I work with translators??? I do not think they will be able to open RESX files? Please advise your existing method of working with them. They mostly know Word... :)


Localization for command text Microsoft Ribbon for WPF

Hello, Is there any way I can localize the command text that comes with the ribbon, like the commands in the Ribbon context menu?   Add to Quick Access Toolbar Add gallery to Quick Access Toolbar Remove from Quick Access Toolbar Show Quick Access Toolbar above the Ribbon Show Quick Access Toolbar below the Ribbon Minimize the Ribbon Maximize the Ribbon   I got this list from the Source -- \Resources\ExceptionStringTable.txt

Automated MVC Application Localization

Hi everyone,I've been asked to localize an existing MVC application which wasn't prepared to be localized from its foundations. As of now I have gathered all the resources from the controllers, using the tool from this website http://resourcerefactoring.codeplex.com/ .This tool allowed me to simply right click any string found on my controllers and generate resources automatically to my Resource file.Since this application is quite big, I've been looking for some application (alike the one I just referenced) that could make this process a little faster by making it easier to localize strings within html tags and so on.Do any of you have suggestions?Thanks in advance.

Problem with MVC and Resource file Localization

 Hello, Having a bit of an issue trying to get localization to work with MVC. I have created a resource file Account.resx under App_GlobalResources which contains my localized strings. Within my view model I am referencing the resource string in the Dispay attribute. public class LogOnModel { [Required] [Display(Name = "USERNAME", ResourceType=typeof(Resources.Account))] public string UserName { get; set; } [Required] [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [Display(Name = "Remember me?")] public bool RememberMe { get; set; } } However when I run app the following exception is displayed from my razor cshtml file.   Cannot retrieve property 'Name' because localization failed.  Type 'Resources.Account' is not public or does not contain a public static string property with the name 'USERNAME'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Cannot retrieve property 'Name' because localization failed.  Type 'Res

localization sitemap on MasterPage

Hi Everyone, i am new in localization.I need to create a website in dual language.I plan to put the sitemap and change language dropdownlist in the master page.May anyone advice on how to i change the sitemap language at treeview and Menu on master page?

Probleme localization usercontrol

Hi,   I try that but and the file is generated : CartSummary.ascx.resx and I've created CartSummary.ascx.en-US.resx my viewCartLinkResource1.Text is détails for fr-FR and viewCartLinkResource1.Text is details for en-US But when I change it, it seems to dont work ...??? even the label price or my basket .... is it because my folder App_LocalResources is in the folder usercontrol ...? There is my website http://onceuponatimejohanna.com/   My user control looks like this : <%@ Control Language="C#" AutoEventWireup="true" CodeFile="CartSummary.ascx.cs" Inherits="UserControls_CartSummary" %><table border="0" cellpadding="0" cellspacing="1" style="width: 174px"> <tr> <td style="width: 93px"> <b><asp:Label ID="cartSummaryLabel" runat="server" meta:resourcekey="cartSummaryLabelResource1" /></b> <asp:HyperLink ID="viewCartLink" runat="server" NavigateUrl="../ShoppingCart.aspx" CssClass="CartLink" Text="(details...)" meta:resourcekey="viewCartLinkResource1" /> <asp:DataList ID="list" runat="server" meta:resourcekey="listResource1"> <ItemTemplate>

Report Builder 3.0 Additional Localization

In our organization there is a requirement to translate the whole Report Builder 3.0 UI in Romanian. As described in http://technet.microsoft.com/en-us/library/dd207038.aspx it seems that Romanian language is not supported. Does someone know the process of creating new languages? It seems that under C:\Program Files\Microsoft SQL Server\MSRS10_50.SQLSERVER2008_1\Reporting Services\ReportServer\ReportBuilder there are some folders named after several cultures and also a folder RptBuilder_3 with similar folders. These folders hold some files having a pattern like ReportBuilder.resources.dll.deploy (maybe compiled .resx files?).

Currency and Localization using C# and asp.net 2.0

  Hello Have anyone got a working code that can set  the currency (and language etc) used on a website based on the location of the person visiting the site?   Thanks cu202
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend