Data Browser - Viewing Site  Sector 23 Code Bank Logged in as:  Guest  


Read .NET Resource Value from JavaScript
Assume you have a resource file MyResources.resx with a name/value pair of "TestValue/TestText"

To read this text from within javascript, use the following syntax:

var myText = '<% = Resources.MyResources.TestValue%>';

However, this only works if the javaScript is being rendered on a .NET page. If it is an external .js file, this does not work.

An easy workaround can be to pass the localized text to the procedures being called.

Created By: amos 6/14/2013 5:58:13 PM
Updated: 6/14/2013 6:06:52 PM