在后台引入外部CSS文件

    protected void Page_Load(object sender, EventArgs e)

  •          {
  •             if (!Page.IsPostBack)
  •              {
  •                  HtmlLink link = new HtmlLink();
  •                  link.Attributes.Add("type", "text/css");
  •                  link.Attributes.Add("rel", "stylesheet");
  •                  link.Attributes.Add("href", url);//url为css路径
  •                 this.Page.Header.Controls.Add(link);
  •              }
  •          }
  • 原文地址:https://www.cnblogs.com/wuhuisheng/p/1771304.html