我正在使用HtmlGenericControl向页眉添加脚本引用。问题是它编码src参数。所以“& mkt = fr-FR”结果为“& amp; mkt = fr-FR”并且没有得到正确的脚本。
var scriptTag = new HtmlGenericControl("script");
scriptTag.Attributes.Add("type", "text/javascript");
scriptTag.Attributes.Add("src", scriptUrl);
更新
这是网址
http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=fr-FR
答案 0 :(得分:3)
<强> Did you try Literal Control - Mode Property ? 强>
<asp:Literal ID="Literal1" Mode="Encode" Text="<script type='text/javascript'
language='javascript' src='Scripts/jquery-1.4.1.min.js'></script>"
runat="server">
</asp:Literal>
<强>输出强>
<script type='text/javascript' language='javascript'
src='Scripts/jquery-1.4.1.min.js'></script>