我的代码中有这个:
<script type="text/javascript"
src="path?key=1234567890">
</script>
我在web.config中添加了这个:
<appSettings>
<add key="key" value="1234567890"/>
如何在上面的代码中实现它?
答案 0 :(得分:2)
您使用System.Web.Configuration.WebConfigurationManager.AppSettings
集合来访问配置设置。
<script type="text/javascript"
src="path?key=<%=WebConfigurationManager.AppSettings["key"]%>">
</script>