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

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>