Calling global variables in the AppSettings from a Javascript function
<p>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:</p>

<p>web.config:</p>

<pre><code>&lt;appSettings&gt;
  &lt;add key="var1" value="123456"/&gt;
&lt;/appSettings&gt;
</code></pre>

<p>default.aspx:</p>

<pre><code>&lt;script type="text/javascript"&gt;
  function doSomething() {"&lt;%= System.Configuration.ConfigurationManager.AppSettings['var1'].ToString(); %&gt;"
};
&lt;/script&gt;
</code></pre>
