I'm trying to access a web.config key in JavaScript, but don't want to add code to a .aspx file. Here's my code:
Web.config file:
<add key="key" value="password"/>
JavaScript file:
var param = '<%= System.Configuration.ConfigurationManager.AppSettings["key"].ToString() %>';
Thoughts on what could be going wrong?
Thanks!
appSettings.