Last post Sep 21, 2007 11:12 AM by kahlua
Sep 20, 2007 07:39 PM|kahlua|LINK
Am I missing something here?
I have a simple asp.net 2.0 website. I have a Default.aspx file in the root and 2 resource files in the App_LocalResources folder #1 Default.resx (english), #2 Default.zh-cn.resx (chinese). In my default.aspx.cs I have:
protected override void InitializeCulture()
string Language = "zh-cn";
this.UICulture = Language;
this.Culture = Language;
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Language);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(Language);
In the default.aspx page I have 1 label control:
"lblTest" runat="server" meta:resourceKey="lblTestResource1">
And in the 2 resources files I have a entry for lblTestResource1.Text, both with different values. When I run the page, nothing shows up! I see the label being rendered, but its text has no value.
I hardcoded the language, I tried changing from "zh-cn" to "en-us", which will default to default.resx, but doesnt matter what I do. I know the UICulture is being set becuase i response.write it in the page_load and it shows the language
I set. Any clues? Thanks in advance!
Sep 21, 2007 05:23 AM|kipo|LINK
You should rename your Resource files into Default.aspx.resx and
Sep 21, 2007 11:12 AM|kahlua|LINK
duh! Thanks, I saw in several places that to prevent naming conflicts you should cut off the aspx, I guess there's more to it, thanks again.