views:

70

answers:

1

Hello guys,

I used localization helper from Matt Hawley. It's really working great. I have a problem though in getting the values on javascripts/jquery.

I can't retrieve the resources text using this: example: alert('<%=Html.Resource(\"Strings,SomeKey\")%>');

Any help is greatly appreciated.

Best

+2  A: 

Hello guys,

Thank you BalusC for the reply. Greatly appreciated. I already got a work around. I declared variable on my .aspx page with the resources key values. Then call the variable on my separate js. So I have it like this:

In my aspx page.

<script>
 var foo="<%=Html.Resource("Strings,SomeKey")%>";
</script>

In my js. I just simply called the variable foo.

alert(foo);

There I have it!:)

I got it wrong for the first time since my variable was declared on my external js. Therefore asp.net will not be able to interpret it. Instead it will be rendered as plain text.

Best regards

samer