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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How to use the DNN Label ControlHow to use the DNN Label Control
Previous
 
Next
New Post
2/13/2007 6:46 PM
 

I am developing an application for a client that wants to implement the DNN style context sensitive field help.  I have been searching this forum and the web to find out how to do this.  It took me quite a while just to determine that it is the DNN Label control.  Past that, any information is VERY spotty.

Can I install this control into the toolbox and drag it onto my page, or do I need to hand-code it in the markup?

Where does it retrieve the context sensitive help text from?

Thank you.

 
New Post
2/13/2007 8:53 PM
 
I can't comment on the ability of being able to use the LabelControl from the toolbox as I rarely, if at all, use a visual designer for my user controls. I tend to develop all of my modules in a dynamic manner through my code behind (ala server controls).

In order to create one dynamically, you can do something like this:

' Imports.
Imports DotNetNuke.UI.UserControls

' Declarations.
Private lblActive As LabelControl
Friend Const LC_PATH As String = "~/controls/LabelControl.ascx"

' In your method that creates your controls...
lblActive = CType(LoadControl(LC_PATH), LabelControl)
With lblActive
    .ID = "lblActive"
    .ControlName = "chkActive"
    .ResourceKey = "lblActive"
End With
Me.Controls.Add(lblActive)

The ControlName & ResourceKey are your keys to where the control gets its label text and help text.

This gets pulled from a resource file, in my case this user control was called Settings.ascx so there is a resource file named Settings.acsx.resx. In there, you would have entries like the following:

lblActive.Text = "Active:"
lblActive.Help = "Use this to set whether the module is active or not."

To do it in the ascx instead of the code behind:

' Up top.
<%@ Register TagPrefix="Portal" TagName="URL" Src="~/controls/URLControl.ascx" %>

' In your layout.
<dnn:label id="lblActive" runat="server" controlname="chkActive"></dnn:label>

In this case, I don't believe you need to specify the ResourceKey as it is automatically picked up from the id attribute. The same resource entries would be needed as specified above.

Hope this helps.
 
New Post
2/13/2007 11:40 PM
 

Ed,

Thank you for your input.  After I posted that message, I continued doing some digging and I tried to implement it myself.  The approach I took was the second way you illustrated in the ascx.  The only difference was that I registered a different control up top.  I didn't register a URLControl, but rather some sort of label control.  I hate to be vague, but I can't get into my PC at work right now to look at exactly what I did, but I will be able to do so tomorrow morning.

The thing is, I thought I had it licked, and it's close, but I'm missing something.  What happens (or rather what doesn't happen) when I hover my mouse pointer over the '?' icon is that there is no tooltip that pops up.  If I click on the icon, then a small yellow box appears except it is so narrow that if there is any text in there it can't be seen.  I tried looking at the attributes of my table to make sure that the table size wasn't somehow restricting the size of the cell, but that didn't seem to be the problem.

Do you think if I register the URLControl instead it will work?  I'm puzzled because I basically copied and pasted the syntax right out of DotNetNuke's login module.  I also added the helptext entry into the resource file and made sure that all of the control names were in sync.

So that's where I'm at.  I'm certainly anxious to get to it tomorrow morning and hopefully get it working.  Do you have any comments based upon what I've shared here?

I appreciate your help!

 
New Post
2/14/2007 8:22 AM
 
My bad, that should have been the LabelControl registered, not the URLControl.



If you're not getting the mouse over or the help text when clicking on the help icon, then it looks like the controls resource file is either not being found or the entry within it isn't being found.

You need a resource file in the App_LocalResources folder for your module that has the same name as your usercontrol. In that file, you need 2 entries for your LabelControl.

ex:

MyModule\App_LocalResources\MyModule.acsx.resx

MyLabelControl.Text = "Some text"
MyLabelControl.Help = "Some help in here"
 
New Post
2/14/2007 1:50 PM
 

OK, I am officially pulling my hair out.  I have tried everything.  Unfortunately I am going to have to let this go, because I have some other things that I have to get accomplished for this client, and I can't afford to lose anymore time messing with this.

I created my own resource file with the same name as my ascx file.  The resource file is the same name as the ascx file with .resx as a final suffix.  This resource file is located in the App_LocalResources folder in the same directory as my ascx file.  I can't think of anything else to try.  I've poured over every single minute detail.  I've even  made up a few details to look at!

Anyway, I will post some images here to show you what I'm dealing with and see if anything pops out to anyone else.

Here is what I am getting on my page when I click the "?" icon.

OK, so much for that.  The forum won't allow me to upload images.  Anyway, here is some code snippets.

In my form:
<dnn:label id="plAddress1" controlname="ctlLBLAddress1" runat="server" meta:resourcekey="plAddress1"/>

At the top of my form:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="STWM_TAX_OE_InputSpecs.ascx.vb" Inherits="ASAP.Modules.STWM_TAX_OrderEntry.OE_InputSpecs" %>
<%
@ Register Assembly="Infragistics2.WebUI.UltraWebGrid.v6.1, Version=6.1.20061.1030, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.WebUI.UltraWebGrid" TagPrefix="igtbl" %>
<%
@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>

The name of my form is STWM_TAX_OE_InputSpecs.ascx, and the name of my resource file is STWM_TAX_OE_InputSpecs.ascx.resx

I have entries in my resource file with names of plAddress1.Help and plAddress1.Text.  Each of these name values have text strings for the values.

Can anyone see anything I'm overlooking?

Thanks.

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How to use the DNN Label ControlHow to use the DNN Label Control


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