繁体   English   中英

在 javascript src google map api 中调用 web 配置值

[英]call web config value in javascript src google map api

我在使用 javascript 访问 webconfig 文件时遇到问题,这是我的 javascript 方面...

<script type='text/javascript' src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=<%=ConfigurationManager.AppSettings["GoogleAPIKey"]%>"></script>

正在访问 webconfig 但我收到一个错误...

这是 web.config

<add key="GoogleAPIKey" value="key api"/>

非常感谢您的帮助。。

这是我的问题的解决方案..

<script type='text/javascript' src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=<asp:Literal runat="server" ID="LitGoogle" />" ></script>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM