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.
views:
243answers:
1
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
2010-05-04 05:46:21