asp.net - Read web.config values from Javascript -
i want read app key web.config file via java script. web.config key read
<appsettings> <add key="key1" value="value1" /> <appsettings>
i include following inside java script function.
function evaluate() { var key = '<%=configurationmanager.appsettings["key1"].tostring() %>'; alert(key); }
however, end getting <%=configurationmanager.appsettings["key1"].tostring() %>
in alert.
what missing?
the <%= =>
tag going execute if within .aspx
file. if place within .js file, other text. in order code work, javascript posted have embedded within .aspx file.
Comments
Post a Comment