I am using DNN 7.04.
I am trying to get a string from a resource file and have tried these:
var path1 = Localization.GetString("MyAdsPath.Text", LocalResourceFile);
var path2 = Localization.GetString("MyAdsPath.Text", LocalResourceFile + "/AdditionalInfo.ascx.resx");
path1 returns null and path2 returns the correct string from the resource file.
In both cases LocalResourcfile returns:
/desktopmodules/qEmployerCreateAd/App_LocalResources/
The problem is I don't want to hard code the resource file name as it will change when the language changes.
I think the issue is to do with the control being dynamically loaded. Do I have to check the culture and then hard code the resource file name? Or is there a better solution?
thanks Norb
I found a solution that works:
http://weblogs.asp.net/anasghanem/fixing-dotnetnuke-localization-for-child-and-dynamically-loaded-usercontrols
In case that link dies here is the solution:
Create a base UserCotrol class that inherits from PortalModuleBase and fix the LocalResourceFile like below :