I'm working from the example given here:
I keep receiving an error:
[tt]
Could not find any resources appropriate for the specified culture (or the neutral culture) on disk.
baseName: resource locationInfo: <null> fileName: resource.resources
[/tt]
This occurs the first time I attempt to GetString (line 30 in the sample). I do have the resources files in a folder called resource, and the best I can tell that's where this page should be looking. The resource files are valid, I opened them with a resource editor.
Does anyone have any idea what I am doing wrong?
Relevant code:
[tt]
CultureInfo ci;
switch (Radiobuttonlist1.SelectedValue.ToString()){
case "gu-CH" :
case "pi-TA" :
ci = new CustomGuamCulture("es-ES", Radiobuttonlist1.SelectedItem.Value.ToString(), Radiobuttonlist1.SelectedItem.Text);
break;
default :
ci = new CultureInfo(Radiobuttonlist1.SelectedValue.ToString());
break;
}
Thread.CurrentThread.CurrentCulture = ci;
Thread.CurrentThread.CurrentUICulture = ci;
ResourceManager rm = ResourceManager.CreateFileBasedResourceManager("resource", Server.MapPath("resources") + Path.DirectorySeparatorChar, null);
lblGreeting.Text = rm.GetString("Greeting");
[/tt]
I keep receiving an error:
[tt]
Could not find any resources appropriate for the specified culture (or the neutral culture) on disk.
baseName: resource locationInfo: <null> fileName: resource.resources
[/tt]
This occurs the first time I attempt to GetString (line 30 in the sample). I do have the resources files in a folder called resource, and the best I can tell that's where this page should be looking. The resource files are valid, I opened them with a resource editor.
Does anyone have any idea what I am doing wrong?
Relevant code:
[tt]
CultureInfo ci;
switch (Radiobuttonlist1.SelectedValue.ToString()){
case "gu-CH" :
case "pi-TA" :
ci = new CustomGuamCulture("es-ES", Radiobuttonlist1.SelectedItem.Value.ToString(), Radiobuttonlist1.SelectedItem.Text);
break;
default :
ci = new CultureInfo(Radiobuttonlist1.SelectedValue.ToString());
break;
}
Thread.CurrentThread.CurrentCulture = ci;
Thread.CurrentThread.CurrentUICulture = ci;
ResourceManager rm = ResourceManager.CreateFileBasedResourceManager("resource", Server.MapPath("resources") + Path.DirectorySeparatorChar, null);
lblGreeting.Text = rm.GetString("Greeting");
[/tt]