zoukankan      html  css  js  c++  java
  • ASP.net后台动态加载Css文件

    代码
    //假设css文件:TestCss.css

    #region 动态加载css文件
    HtmlGenericControl _CssFile
    = new HtmlGenericControl("link");
    _CssFile.ID
    = "CssFile";
    _CssFile.Attributes[
    "rel"] = "stylesheet";
    _CssFile.Attributes[
    "type"] = "text/css";
    _CssFile.Attributes[
    "href"] = "TestCss.css";
    if (this.FindControl(_CssFile.ID) == null)
    {
    this.Header.Controls.Add(_CssFile);
    }
    #endregion 动态加载css文件

    这种方法适用于以下情况:

    1.所有页面需要加载相同的css文件;

    2.所有页面需要加载统一命名规则的css文件;

  • 相关阅读:
    Excel教程(5)
    Excel教程(4)
    Excel教程(3)
    Excel教程(2)
    如何在Excel中少犯二(I)
    for zip
    temp
    study
    eclipse
    shell
  • 原文地址:https://www.cnblogs.com/microtry/p/1778518.html
Copyright © 2011-2022 走看看