What is the best way to inject configuration settings into Javascript in an MVC app?
I’ve seen how it is done using ASP.NET webforms, but not sure how to do this with MVC.
@using System.Configuration
...
var checkTimer = @ConfigurationManager.AppSettings["CheckTimer"];
In Web.config:
<appSettings>
<!-- Polling timer to check for alerts -->
<add key="CheckTimer" value="10000"/>
</appSettings>
But in my rendered output I just get the following:
var checkTimer = ;
1 Answer