asp.net动态添加link标记

代码
//添加:
Header.Controls.Add(GroupManager.GetStyleLink(g.Style));

public static HtmlLink GetStyleLink(int style)
        {
            HtmlLink link 
= new HtmlLink();
            link.Attributes.Add(
"rel""stylesheet");
            link.Attributes.Add(
"type""text/css");
            link.Attributes.Add(
"media""all");
            link.Href 
= "http://www***.com/css/group.css";

            
return link;
        }

//修改:
<span id="spExam" runat="server"></span>

 spExam.Attributes[
"Style"]="display:none";

 

posted @ 2009-12-28 21:54  唔愛吃蘋果  阅读(1234)  评论(0编辑  收藏  举报