What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 3813 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > JavaScript > Read Resource File values in Javascript ...
Niladri.Biswas

Read Resource File values in Javascript

 Code Snippet posted by: Niladri.Biswas | Posted on: 5/19/2012 | Category: JavaScript Codes | Views: 1818 | Status: [Member] | Points: 40 | Alert Moderator   


First create a resource file call "Test". Enter the Name as "TestValue" and the Value as "Some Test Value". Next use the below code

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
<title></title>
<script language="javascript" type="text/javascript">
function Test() {

var value = '<% = Resources.Test.TestValue%>';
alert(value);

}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="Test()" />
</div>
</form>
</body>
</html>


Best Regards,
Niladri Biswas
Found interesting? Add this to:


>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/23/2013 10:53:05 PM