asp.net添加、去除head中的Meta

添加Meta:

1 HtmlMeta keyWords = new HtmlMeta();
2 keyWords.Name = "Keywords";
3 keyWords.Content = "游戏";
4 Header.Controls.Add(keyWords);

去除Meta:

1 using System.Web.UI.HtmlControls;
2
3  for (int i = 0; i < Header.Controls.Count; i++)
4 {
5 if (Header.Controls[i] is HtmlMeta)
6 {
7 Header.Controls.Remove(Header.Controls[i]);
8 }
9 }
10  

 

posted @ 2010-11-18 15:45  零纪录  阅读(409)  评论(0编辑  收藏  举报