Reputation: 207
I created local resource files with VisualStudio (.resx and .fr.resx) for each page. All the text of controls in the .aspx page can be translated now.
But can I also translate strings in my code behind in this loacal resource file? If yes, how can I read the value in code behind out of my local .resx files in my App_LocalResources map?
Upvotes: 7
Views: 3600
Reputation: 52241
You can try...
Simply call the GetLocalResourceObject method on your current page:
GetLocalResourceObject("yourkey").ToString();
GetGlobalResourceObject("MyGlobalResources", "HelloWorldString").ToString();
Upvotes: 7