How can I access the HttpContext.GetGlobalResourceObject () in the javascript (.js) file that is used in my application?

I am using javascript file for validtion. Now I have to localize this javascript file. I want HttpContext.GetGlobalResourceObject () in a .js file. Can I use HttpContext.GetGlobalResourceObject () in my .js file? Is there any other option to localize the javascript file.

+2


a source to share


1 answer


Try the following:

Resource is the name of the resource file and the Hello key is the resource



   <script type = "text/javascript">  
            function ShowGreetings() {  
                var message = '<%=GetGlobalResourceObject("Resource", "Greetings") %>';  
                alert(message);  
            }  
        </script>

      

also read this: http://www.west-wind.com/Weblog/posts/698097.aspx

+1


a source







All Articles