G
Griff
I have attempted to replicate an example of using resource strings in a test
application and I can't get it to work - I wonder whether someone could
kindly point out where I've gone wrong...
DEFAULT.ASPX
This contains the following line:
<%@ Page Culture="Auto" UICulture="Auto" Language="VB" Explicit="true"
Strict="true" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
DEFAULT.ASPX.VB
This contains the following event:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Page.Title = Resources.defaultResource.Hello & " Griff"
End Sub
In the \APP_GLOBALRESOURCES folder I have two files:
defaultResource.resx
defaultResource.fi-FI.resx
INTERNET EXPLORER 6 > LANGUAGES
The top one is: "Finnish [fi]"
IIS
The web project is set to run under IIS, rather than the web server built
into VS2005
WHAT I'M EXPECTING TO HAPPEN
When the default.aspx page loads, it uses the Culture="Auto" attribute (or
the UICulture="Auto" attribute, not sure which) to auto-detect the language
of my browser. Because I have the language set to Finnish it would use the
"defaultResource.fi-FI.resx" file.
WHAT HAPPENS
It's getting the value from the defaultResource.resx file instead
application and I can't get it to work - I wonder whether someone could
kindly point out where I've gone wrong...
DEFAULT.ASPX
This contains the following line:
<%@ Page Culture="Auto" UICulture="Auto" Language="VB" Explicit="true"
Strict="true" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
DEFAULT.ASPX.VB
This contains the following event:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Page.Title = Resources.defaultResource.Hello & " Griff"
End Sub
In the \APP_GLOBALRESOURCES folder I have two files:
defaultResource.resx
defaultResource.fi-FI.resx
INTERNET EXPLORER 6 > LANGUAGES
The top one is: "Finnish [fi]"
IIS
The web project is set to run under IIS, rather than the web server built
into VS2005
WHAT I'M EXPECTING TO HAPPEN
When the default.aspx page loads, it uses the Culture="Auto" attribute (or
the UICulture="Auto" attribute, not sure which) to auto-detect the language
of my browser. Because I have the language set to Finnish it would use the
"defaultResource.fi-FI.resx" file.
WHAT HAPPENS
It's getting the value from the defaultResource.resx file instead