Question:
I have one site, one layout, but many different "themes". these themes are just changes in the CSS. To make a new skin, I have to create a new .ascx file for the skin which contains the EXACT same code as all the others, but its the only way I can use a different css file by giving the same name as the .ascx skin file...
Also I want to add a new skin object I need to be able to "include" all the "Register" and <%=SKINPATH%> etc... in the included file.
Solution:
Put the content of the skin in a file and include that in every ascx skin (this is ASP.NET, not DNN)
The content of your ascx skin would be this:
<!--#include file="myinclude.inc"-->
and the actual skin content would be in the myinclude.inc file.
You still need 50 ascx skins but at least you can make your changes in one file.
A. IncludeExample.ascx
--------------------------------------------------
Content:
<!--#include file="Include.inc"-->
B. Include.inc
--------------------------------------------------
Content:
<%@ Control Language="vb" CodeBehind="~/admin/Skins/skin.vb" AutoEventWireup="false"
Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
<%@ Register TagPrefix="dnn" TagName="NAV" Src="~/Admin/Skins/Nav.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LOGIN" Src="~/Admin/Skins/Login.ascx" %>
<div class="SkinContainer">
<div id="ControlPanel" runat="server">
</div>
<div id="menu">
<dnn:NAV runat="server" ID="dnnNAV" ProviderName="DNNMenuNavigationProvider" CSSControl="main_dnnmenu_bar"
CSSContainerRoot="main_dnnmenu_container" CSSNode="main_dnnmenu_item" CSSNodeRoot="main_dnnmenu_rootitem"
CSSIcon="main_dnnmenu_icon" CSSContainerSub="main_dnnmenu_submenu" CSSBreak="main_dnnmenu_break"
CSSNodeHover="main_dnnmenu_itemhover" NodeLeftHTMLBreadCrumbRoot="<img alt="*" BORDER="0" src="breadcrumb.gif"/>" />
<dnn:LOGIN runat="server" CssClass="Login"/>
</div>
<div id="ContentPane" runat="server" class="ContentPane">
</div>
</div>
Source: Here