0

I googled my query a lot and got so many references, but it created more confusion for me, So I am putting my question here. I do have my Resource file under Resource folder with path Resources\RR.resx, where Key and Value are stored. I want to know a way through which I can access those Key-Value pairs in back-end code.

(Note: Please make sure it's resource file not resource dictionary)

Pratik
  • 103
  • 1
  • 2
  • 10
  • Do you have an IDE-generated "Resources.designer.cs" file? (In your case, that would be "RR.designer.cs") – Dai Dec 11 '14 at 03:51

2 Answers2

0

Considering your example, you can access the Key-Value pair in your code-behind file like,

"Resource.RR.[KeyName]". Here " 'Resource' would be your folder name/Namespace, 'RR' would be your calss name and [KeyName] would be your key.

However, you should also consider that ass soon as we add any resource file default Access Modifier would be 'Internal', you may have to change to public or use it accordingly.

enter image description here

M.K
  • 218
  • 3
  • 10
0
Properties.Resources.ResourceKey;

Please read localization http://msdn.microsoft.com/en-us/library/vstudio/aa992030(v=vs.100).aspx for more information

Mahesh Malpani
  • 1,782
  • 16
  • 27