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

标签 javascript asp.net vb.net google-maps-api-3 jscript.net

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

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

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

这是 网络配置

<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>

关于javascript - 在javascript src google map api中调用网络配置值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39920697/

相关文章:

javascript - 在 contentEditable div 中使用 jQuery 清理粘贴事件

c# - .net c#一次加载XML文件的方法

c# - 如何对 Unicode 进行编码以便 iPad 和 Excel 都能理解?

c# - 我在 WebMatrix 的单独 .cs 文件中对 Server.MapPath 使用什么 using 指令?

c# - 用户控件中的条件

vb.net - 返回数据集中表的前 5 条记录

Javascript - Math.random 函数在 for 循环中调用时返回相同的结果

javascript - 如何将数组作为一个元素插入另一个数组

javascript - 如果验证失败则调用 javascript

vb.net - vb.net中如何继承StringBuilder?