Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Custom UserControl inside Skin (dnn 5)Custom UserControl inside Skin (dnn 5)
Previous
 
Next
New Post
12/10/2009 5:48 PM
 

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

 

 
New Post
12/10/2009 6:46 PM
 

If you have created the skin ascx file there is no need to create a skin html file. 

 
New Post
12/10/2009 7:00 PM
 

Thanks for the response. To help me further understand this, why does the default MinimalExtropy come with both a html and ascx file then? Is it just to show you can use either method?

Thanks again for the response.

 
New Post
12/10/2009 7:41 PM
 

HTML skins get parsed during uploads and converted into .aspx files.

Creating an HTML skin is more robust against DNN versions (move of skin objects and other corrections), but most asp.net developers are sitting in front of the PC, chewing they nails while heavily awaiting the result, when having the extra click for "parse skin" and therefore prefer to modify ascx files directly. However, if you belog to this group, make sure to remove initial .ascx, otherwise a "reparse" will remove any changes you did directly in .ascx file


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
12/11/2009 9:43 AM
 

I don't think "more robust" is correct.  It is just a different way to do it.  It all depends on ones preference.  I tend to work with ascx files (and don't even create the html version) because the sites I work on usually have some non standard requirements that require processing in the skin itself.  as far as nail chewing goes, I prefer a cup of coffee while waiting fror a process to finish :)

But back to the original question, as Sebastian said, html skin files get parsed to the ascx file.  If you just start with an ascx file (no html) file then there is nothing to parse.  the site will just use your ascx file.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Custom UserControl inside Skin (dnn 5)Custom UserControl inside Skin (dnn 5)


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out