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

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedReference skin control from desktop moduleReference skin control from desktop module
Previous
 
Next
New Post
5/21/2012 3:12 PM
 

I have a desktop module (Interactive Product Guide) that is working quite nicely.  I now want to customize the standard breadcrumb.  Here's what I have done.

I went into the skin that is associated with the page and added a label following dnnBreadcrumb.

<div id="dnnbreaderbox">
    <div class="skinwidth">
        <div class="fleft">
            <dnn:BREADCRUMB ID="dnnBreadcrumb" runat="server" RootLevel="0" cssclass="dnnbreader" Separator="&nbsp; &gt; &nbsp;" />
            <asp:Label ID="lblSMCBreader" runat="server" cssclass="dnnbreader" Text=""></asp:Label>
        </div>
        <dnn:LOGIN ID="dnnLogin" CssClass="Login" runat="server" />
        <dnn:USER ID="dnnUser" CssClass="User" runat="server" />
    <div class="clr"></div>
    </div>
</div>

I now want to reference the new label (lblSMCBreader) from the code behind in my desktopmodule.  I've tried using variations of FindControl to locate the skin's user control as well as my label but it comes up with nothing.  If I view the page source at runtime I see my label has been changed to dnn_lblSMCBreader.

How do I access the lable I added to the skin?

Thanks,

Dave

 
New Post
5/21/2012 5:50 PM
 

Hello,

I think you're looking for this:

DotNetNuke.UI.Skins.Skin.GetParentSkin(Me).FindControl("lblSMCBreader")

Still, you want to be pretty careful doing that because the user could select a skin to which you haven't added that label. Of course, you could add some protections in case it can't find that control. 

As an alternative, you could look at creating a skin object to replace the default breadcrumb object. You could also think about dynamically finding the breadcrumb (which will be more common in skins) and then adding your label dynamically.

Hope this helps,

Mike

 
New Post
5/22/2012 12:18 PM
 
Worked like a champ. Thanks for the help!
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedReference skin control from desktop moduleReference skin control from desktop module


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