views:

19

answers:

1

This is really simple, can't understand why I can't get it working. In asp.net 3.5 I'm trying to use localization and French using Global Resources. But it never uses the French resource file.

I have three files: Default.aspx, Resource.resx, Resource.fr.resx.

In Default.aspx:

<%@ Page Language="C#" AutoEventWireup="true" Culture="fr-FR" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Label ID="lblWelcomeMsg" runat="server" Text="<%$ Resources:Resource, welcomeMessage %>"></asp:Label>

In App_GlobalResources/Resource.resx:

Name: welcomeMessage
Value: Welcome

In App_GlobalResources/Resource.fr.resx (have also tried using Resource.fr-FR.resx):

Name: welcomeMessage
Value: Bonjour

The problem is that it always says "Welcome" even if I set the culture to "fr-FR". I have also tried to set the language in the browser but nothing happens. What am I doing wrong?

A: 

I needed to set the culture in web.config for example (for auto):

<globalization culture="auto" uiCulture="auto"/>
Martin