Share Pastebin
Guest
Public paste!

mdata

By: a guest | Aug 7th, 2009 | Syntax: HTML | Size: 1.56 KB | Hits: 162 | Expires: Never
Copy text to clipboard
  1.  <%@ Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
  2.  
  3.  <asp:placeholder id="SkinPlaceholder" runat="server">
  4.    <link rel="stylesheet" type="text/css" id="csslink" runat="server" />
  5.    <div id="ControlPanel" runat="server" />
  6.    <div id="ContentPane" runat="server" class="ContentPane Pane" />
  7.  </asp:placeholder>
  8.  
  9. <script runat="server">
  10.     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  11.     '**  Skincovered.com Portal Alias based skin switcher
  12.     '**  Switches the skin depending on the Url used to access the site
  13.     '**  Select this skin (topmenu_switch) as would any other skin in DotNetNuke
  14.     '** The code below will load a skin from the same folder depending on the Url
  15.         Dim skin As String = ""
  16.         Dim HostName As String = Request.ServerVariables("SERVER_NAME").ToLower()
  17.         Select HostName.Remove(HostName.IndexOf("."))
  18.             Case "foo":
  19.                 skin = "foo"
  20.             Case "bar":
  21.                 skin = "bar"
  22.             Case Else:
  23.             'this skin will be loaded if no matches were made to the portal aliases above
  24.                 skin = "default"
  25.         End Select
  26.  
  27.         'this line loads the actual skin.
  28.         Dim sc As Control = LoadControl(skin+".ascx")
  29.         SkinPlaceholder.Controls.Remove(ControlPanel)
  30.         SkinPlaceholder.Controls.Remove(ContentPane)
  31.         SkinPlaceholder.Controls.Add(sc)
  32.         csslink.Attributes.Add("href", SkinPath+skin+".css")
  33.     End Sub