Hello:
I am using .NET 2.0
I set culture in code-behind, regardless the Browser language settings.
Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
Dim lang As String = CStr(IIf(CStr(Session("Lang")).ToLower = "french", "fr-CA", "en-CA"))
Dim ci As New System.Globalization.CultureInfo(lang)
System.Threading.Thread.CurrentThread.CurrentCulture = ci
System.Threading.Thread.CurrentThread.CurrentUICulture = ci
End Sub
So under \App_LocalResources, I added two culture-specific file:
Help.aspx.en-CA.resx
Help.aspx.fr-CA.resx
so here is I want to display a lable text:
<asp:Label ID="lblTitle" runat="server" Text="<%$ Resources:lblTitle.Text %>" ></asp:Label>
when I compiles it give me error: The resource object with key 'lblTitle.Text' was not found.
However, if I create a culture-neutral resource file like this: Help.aspx.resx
Everything works fine!
my question, why I need this culture-neutral file, giving that all keys in that file are empty, seems have no use at all
I even specified in Web.Config to default the language to 'en-CA' like this:
<globalization uiCulture="auto:en" culture="auto:en-CA" />
still doesn't work as long as that Help.aspx.resx is not there.
Can somebody help me on this?
Thank you