In my javascript function I am trying to call my global variable that is currently defined in the webconfig file of my Asp.net project. What is the syntax for this? I've looked around and nothing seems to work so far. I've tried the following but I am not getting anything from it:
web.config:
<appSettings>
<add key="var1" value="123456"/>
</appSettings>
default.aspx:
<script type="text/javascript">
function doSomething() {"<%= System.Configuration.ConfigurationManager.AppSettings['var1'].ToString(); %>"
};
</script>