比如规定某个目录下所有页面使用同一种样式,这样就不用每个页面都加个<link...>了。

解决方案 »

  1.   

    据我所知不能1. 用 master page
    2. 代码动态加入public class YourPage : PageBase
    {
         // ...
    }public class PageBase : System.Web.UI.Page
    {
           protected override void OnInit(EverntArgs e) {
                   base.OnInit(e);
                    
        HtmlLink myHtmlLink = new HtmlLink();
        myHtmlLink.Href = "~/StyleSheet.css";
        myHtmlLink.Attributes.Add("rel", "stylesheet");
        myHtmlLink.Attributes.Add("type", "text/css");    // Add the HtmlLink to the Head section of the page.
        Page.Header.Controls.Add(myHtmlLink);       } 
    }
      

  2.   

    .NET 2.0 中可以用主题
    http://www.entlib.net.cn/html/2008-07/46.html
      

  3.   

    可以在web.config的pages节点里设置styleSheetTheme或者theme实现
      

  4.   

    可以在App_theme文件夹里加入样式,设置好字体, 因为是全局的, 所以可以
      

  5.   

    全局控制用Theme
    可以添加一个App_Themes目录
      

  6.   

    用Theme 吧,不过对自定义的空间不行