Last post Feb 21, 2014 05:42 AM by jsiahaan
Feb 21, 2014 05:05 AM|hemantwithu|LINK
I have a web application which should be Localized to 3 languages. All the controls are taking the control text from the Resx file of that language. Now I have scenario like suppose if we have a messages,custom error messages to show for that particular
culture. So for this I have created a seperate Foldere as "Resources" and created a resx as "DialogMessages.ar-IQ.resx".
How can I read the "DialogMessages.ar-IQ.resx" in C# ?
I have tried to read the file using ResxResourceReader class. Is this a correct process or any flaw exists ?
Feb 21, 2014 05:34 AM|smirnov|LINK
Create App_GlobalResources folder, put your resx files there and refer to the keys from the code as
You can also read http://msdn.microsoft.com/en-us/library/gg418542(v=vs.110).aspx
Feb 21, 2014 05:42 AM|jsiahaan|LINK
You can call using folder where the resource file is created. This folder become a nameSpace. for resource:
Yours to be like this:
var readFromResource = <FolderName>.DialogMessages.ar-IQ.<sourePropertyName>
<FolderName> is full folder name of the location of DialogMessages.ar-IQ.resx
<sourcePropertyName> is the property defined inside resource file
Hope this can help