title: MVC4 read a AppKey value from web.config via javascript
body: <p>I've looked at some post concerning the argument
  but I'm still missing something</p>
  
  <p>because I can't read the key (in the appSettings tag of Web.config)</p>
  
  <pre><code> &lt;add key="ROOT_URL_SERVER" value="hello" /&gt;
  </code></pre>
  
  <p>with this javascript in this view (MVC4)</p>
  
  <pre><code>&lt;input type="text" value="@ViewBag.prova" /&gt;
  
  &lt;script type="text/javascript"&gt;
  
          var t = '&lt;%=ConfigurationManager.AppSettings["ROOT_URL_SERVER"].ToString()%&gt;';
          var type = '&lt;%= ConfigurationManager.AppSettings["ROOT_URL_SERVER"] %&gt;';
          var appSettingValue = '&lt;%=System.Configuration.ConfigurationManager.AppSettings["ROOT_URL_SERVER"]%&gt;';
  
          alert(t);
          alert(type);
          alert(appSettingValue);
  
      &lt;/script&gt;
  </code></pre>
  
  <p>even if it works when i pass the value by the viewbag with the code</p>
  
  <pre><code>{
              string test = ConfigurationManager.AppSettings["ROOT_URL_SERVER"].ToString();
              ViewBag.prova = test;
  
              return View();
          }
  </code></pre>
  
  <p>Can you help me fix this problem?
  Thank you!</p>