当前位置: 代码迷 >> ASP.NET >> 怎么动态切换css 出现有关问题
  详细解决方案

怎么动态切换css 出现有关问题

热度:10070   发布时间:2013-02-25 00:00:00.0
如何动态切换css 出现问题
public static void SwitchCSS(Page page, string CSSFilePath)
  {
  HtmlLink link = new HtmlLink();
  link.Href = CSSFilePath;
  link.Attributes["rel"] = "stylesheet";
  link.Attributes["type"] = "text/css";
  if (page != null) 
  {
  page.Header.Controls.Add(link);
  }  
  }


错误!!!!!!!!!!!!!!!
Object reference not set to an instance of an object.
不知道是link那里出现了什么问题~~~

------解决方案--------------------------------------------------------
head在你的母版页里面。BaseLayout.Master页面里面。
  相关解决方案