|
Question : ASP.NET - Reading from resource file
|
|
hi... im trying to get values from resource file using the resource manager: 1) i created in VS.NET , "resource.he.resx" 2) i inserted few name - values 3) in webform codebehind i tried to print some value // creates a resource manager ResourceManager rm = ResourceManager.CreateFileBasedResourceManager("he",".",null); Response.Write(rm.GetString("RM_car")); im getting this error : Could not find any resources appropriate for the specified culture (or the neutral culture) on disk. baseName: he locationInfo: fileName: he.resources what am i missing ?
thanks in advance
|
|
Answer : ASP.NET - Reading from resource file
|
|
Have you set the appropriate culture for this resource because rm.GetString("RM_car") will get the value for the current culture - and if doesn't find resource for the current culture it will search for the default culture - have you create a resource for the default culture ?
try this
CultureInfo ci = new CultureInfo("he"); ResourceManager resmgr = new ResourceManager("YourNameSpace.resource", Assembly.GetExecutingAssembly()); string msg = resmgr.GetString(messageId,ci);
HTH B..G
|
|
|
|