I am trying to read apiUrl key value from web.config file so that I can take advantage of the .net transform config to manage deployment in different environments. Here is my Webconfig code:
<appSettings>
<add key="url" value="http://localhost:6299/api/"
</appSettings>
and in the plain js file I have this code:
var apiUrl = '<%=ConfigurationManager.AppSettings["url"].Tostring()
%>'.
It is not giving the url value. How can I read web.config value in javascript file?