views:

243

answers:

1

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

A: 

Try this :

Resource is the name of Resource file and Greetings is Resource key

   <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

Pranay Rana