复制代码 代码如下:
HtmlGenericControl Include2 = new HtmlGenericControl("script");
Include2.Attributes.Add("type", "text/javascript");
Include2.InnerHtml = "alert('JavaScript in Page Header');";
this.Page.Header.Controls.Add(Include2);
注, 或使用:
复制代码 代码如下:
Literal li = new Literal();
li.Text = "<script...</script>";
this.Page.Header.Controls.Add(li);
HtmlGenericControl Include2 = new HtmlGenericControl("script");
Include2.Attributes.Add("type", "text/javascript");
Include2.InnerHtml = "alert('JavaScript in Page Header');";
this.Page.Header.Controls.Add(Include2);
注, 或使用:
复制代码 代码如下:
Literal li = new Literal();
li.Text = "<script...</script>";
this.Page.Header.Controls.Add(li);
标签:
动态加载,Js,Head
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com
暂无“动态加载Js代码到Head标签中的脚本”评论...