Wednesday, April 23, 2014

I could read the line item in an ASP.NET resource (.resx) if it was named "Whatever.Text" but not if it was merely named "Whatever" standalone.

This works:

string myPath = "~/MyFolder/SomethingErOther.ascx.resx";
MyHiddenField.Value = Localization.GetString("Whatever.Text", myPath);

 
 

This doesn't:

string myPath = "~/MyFolder/SomethingErOther.ascx.resx";
MyHiddenField.Value = Localization.GetString("Whatever", myPath);

 
 

Both of the above assume that Whatever or Whatever.Text corresponds to a key in the .resx. I don't understand the .Text convention yet. I am trying to pull copy from an .resx into an asp:HiddenField control in the name of allowing the .resx data to then be slurped into JavaScript.

No comments:

Post a Comment