| public void ChangeCSS(string CSSValue) |
| { |
| HtmlLink css = new HtmlLink(); |
| |
| if (CSSValue == "") |
| { |
| CSSValue = "default"; |
| } |
| |
| //DotNetNuke Specific |
| string skinPath = PortalSettings.ActiveTab.SkinPath; |
| //Generic |
| //string skinPath = @"/css/"; |
| |
| string selectedCSS = skinPath + CSSValue + ".css"; |
| |
| css.Href = selectedCSS; |
| |
| css.Attributes["rel"] = "stylesheet"; |
| |
| css.Attributes["type"] = "text/css"; |
| |
| css.Attributes["media"] = "all"; |
| |
| css.Attributes["id"] = "themestyle"; |
| |
| Page.Header.Controls.Add(css); |
| |
| } |
| |
| protected void Page_Init(object sender, EventArgs e) |
| { |
| ChangeCSS("cssValue"); |
| } |