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

 

posted on 2012-03-20 14:49  Asa.Zhu  阅读(300)  评论(0编辑  收藏  举报