ok here is some inline code you can use in your .ascx skin ( or convert it to a skinobject )
Put the following code right above the first html part of your skin
you need to change the code for the hostnames of your various servers youw ant to use it on. But this just loads a differnt css based on the hostname
<script runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strCSSFile As String = "localhost.css"
Select Case Request.Url.Host.ToString
Case "domain1.com"
strCSSFile = "domain1.css"
Case "domain2.com"
strCSSFile = "domain1.css"
Case Else
End Select
'Find the placeholder control
Dim objCSS As Control = Page.FindControl("CSS")
If Not objCSS Is Nothing Then
'First see if we have already added the <LINK> control
Dim objCtrl As Control = Page.Header.FindControl(ID)
If objCtrl Is Nothing Then
Dim skinpath As String = String.Empty
skinpath = CType(Me.Parent, Skin).SkinPath
Dim objLink As New HtmlLink()
'objLink.ID = CreateValidID(Name)
objLink.Attributes("rel") = "stylesheet"
objLink.Attributes("type") = "text/css"
objLink.Href = skinpath + CSSPath + strCSSFile
AddStyleSheet(objCSS, -1, objLink)
End If
End If
End Sub
Protected Sub AddStyleSheet(ByVal cssRoot As Control, ByVal InsertAt As Integer, ByVal link As Object)
cssRoot.Controls.AddAt(InsertAt, link)
End Sub
</script>
Armand Datema
Get my new skin ( lots of design variations [18 headers, 30 titlebars, 30 breadcrumbs, 3 footers ], 50+ typography containers , 50+ page templates and an online theme builder for unlimited skin variations) Aura>
For all your skin conversions
2DNN
Follow me on Twitter