I have created a new skin for dnn 5 and everything looks great and works great, up until I try and add a usercontrol to the skin. I'm still pretty new to dnn so hopefully someone can help me out. I want to add a dynamic label into the skin (index.ascx). To do this, I created a usercontrol in the admin/skins directory. I called it MyLabel. The code looks like this
Design Side:
<%@ Control Language="VB" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Controls.MyLabel" CodeFile="MyLabel.ascx.vb" %>
<asp:Label ID="lblMyLabel" runat="server" style="padding: 0 0 0 5px;" Enableview_state="false" /> Item(s)
Code Behind:
Namespace DotNetNuke.UI.Skins.Controls
Partial Class MyLabel
Inherits UI.Skins.SkinObjectBase
Const MyFileName As String = "MyLabel.ascx"
#Region " Web form Designer Generated Code "
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
End Class
End Namespace
In the skin file (.ascx) I added this
<%@ Register TagPrefix="dnn" TagName="MYLABEL" Src="~/Admin/Skins/MyLabel.ascx" %>
<div class="floatright" style="padding-right: 5px; padding-left: 5px;">
<dnn:MyLabel runat="server" id="dnnMYLABEL" />
</div>
In the .html file I added this
<div class="floatright" style="padding-right: 5px; padding-left: 5px;">
<object id="dnnMYLABEL" codetype="dotnetnuke/server" codebase="MYLABEL">
</object>
</div>
This method works up until I go in and parse the skin package. When I parse it, the parse replaces the <dnn:MyLabel runat="server" id="dnnMYLABEL" /> with <object id="dnnMYLABEL" codetype="dotnetnuke/server" codebase="MYLABEL"></object>
I'm not sure if this is simply an issue with the skin parser, or that I am simply going about doing this wrong.
Please help!!! Thanks
Frank