Hi
You could do that but then it would be screwed up on every dnn update
, I woudl sugeest a different wway. This is also how I do it
IN your skin.css reference your own default css ( this css is copied along with all your skins )
this is how my skin.css starts up
@import url("css/reset.css");
@import url("css/dnncrap.css");
reset is a stylesheet taht resets all default html styles
dnncrap is here i put all css neeeded for dnn action menu controlpanel etc etc
In here you could also put your h1 h2 etc ( altho i usually put that in another external text.css
Then in my ascx skin i have the following code block, in strfilenames i put the css files I dont want loaded ( portal.css default.css and any other css file that is injected there because of third party modules that
Then if user is admin or host i let the css in there and if not remove them so we dont see them in the page.
This way i can keep my skins clean and dont have to worry about those crappy Normal classes that are ijected like everywhere and just have one css with my real html classes and overrides.
Because i dont realy care about how it looks a bit differnet for host or admin user they can have all the css files that dnn intended but for my normal users that is not needed they only have to see it teh way I intended it without weird surprizes because of injected html or classes ( I NEVER use .Normal in my skin totally useless )
<script runat="server">
Protected Sub UnloadCss(ByVal sFileName As String)
Dim oCSS As Control = Me.Page.FindControl("CSS")
For Each oControl As Control In oCSS.Controls
Select Case oControl.GetType.ToString
Case "System.Web.UI.HtmlControls.HtmlLink"
Try
Dim oLink As HtmlLink = CType(oControl, HtmlLink)
If Regex.IsMatch(oLink.Attributes("href"), sFileName, RegexOptions.IgnoreCase) Then
oLink.Visible = False
End If
Catch ex As Exception
Response.Write("<!--Error removing Stylesheet-->")
End Try
End Select
Next
End Sub
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strFileNames As String = "portal.css,default.css,thickbox.css"
Dim skinDocType As Control = Me.Page.FindControl("skinDocType")
If Not skinDocType Is Nothing Then
CType(skinDocType, System.Web.UI.WebControls.Literal).Text = "<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">"
End If
Dim mUser As DotNetNuke.Entities.Users.UserInfo = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo
If mUser.UserID < 1 Then
'User Not Logged In
For Each s As String In strFileNames.Split(",")
UnloadCss(s.Trim)
Next
Else
If mUser.IsSuperUser Or mUser.UserID = PortalSettings.AdministratorId.ToString Then
'admin or host
Else
'normal user
For Each s As String In strFileNames.Split(",")
UnloadCss(s.Trim)
Next
End If
End If
End Sub
</script>