I want to use global resource in my javascript code. Normally, when the code is inside the ASP code, I use
<%=GetGlobalResourceObject("Resource", "MONTHS_SHORT1") %>
and it works. But, when the javascript code is not inside the ASP code, for example in a folder as calendar.js, it does not work. How can I use the global resource in this case? Note: The resource file is inside my App_GlobalResources folder.
I want to use global resource in my javascript code. Normally, when the code
Share
Look at the following post I created describing how you can serialise global and local resources and retrieve them from javascript using jQuery and JSON.
http://bloggingdotnet.blogspot.com/2010_02_01_archive.html
Firstly, create a new handler (.ashx) file. This one was written quite some time ago, so uses vb.net and custom JSON serialisation:
When that is working, use the following jQuery code to make an ajax call to the http handler and return the contents of the resource file as an object literal.