is there anyway i can access my resource files (.resx) in javascript?
if no then are there any workarounds to diplay messages in javascript in different languages?
views:
56answers:
3
A:
Is it a separate javascript file? You can always use an asp literal to insert text into your html page (for exemple: var myString = '<asp:literal id="myLiteral" />';
) and fill the literal serverside.
GôTô
2010-09-24 09:02:50
+2
A:
If your javascript is in the page you can use:
var globalResource = '<%= Resources.YourClass.YourResourceKey %>';
to access the Global Resources (/App_GlobalResources). Or
var localResource = '<%= GetLocalResourceObject("LocalResourceKey").ToString() %>';
to access the Local resources (/App_LocalResources relative to the page position).
Or a javascript solution may be this nice jQuery plugin.
tanathos
2010-09-24 09:40:01
A:
i did it by using Jquery ajax which calls a serverside GetGlobalResourceObject()
scatman
2010-10-26 08:39:48