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...DNN Platform (o...DNN Platform (o...DNN 5 - ModuleId and TabId always -1 in nested controlDNN 5 - ModuleId and TabId always -1 in nested control
Previous
 
Next
New Post
3/13/2009 7:37 PM
 

I'm writing a custom module for DNN 5, and I need a "Manage" link to be on every control in the module. I created a new UserControl ("ManagerLink") that inherits from PortalModuleBase, put my link into that control, and dropped that control on ALL OF MY MAIN CONTROLS.

The problem is that ModuleId and TabId are always -1 in "ManagerLink" nested control. PortalId works just fine, and I can get a TabId by doing PortalSettings.ActiveTab.TabID.

  1. Why can't I get ModuleId and TabId in from "ManagerLink" control, even though it inherits from PortalModuleBase?

  2. Is there an alternative method to get ModuleId (equivalent of PortalSettings.ActiveTab.TabID)

 
New Post
3/13/2009 10:51 PM
 

 I ran into this myself. I haven't done any research into it, but I figure it isn't being loaded by DNN, so there is no moduleID to assign it. 

What I did is put a label on the subControl and a public property that sets the value of the moduleID as the text of the label. I can then 'access' the moduleId via either the label or the property (I use the property).

 

 
New Post
3/14/2009 1:20 PM
 

Since the child control inherits from PortalModuleBase, I would do the following in the Page_Load handler of the parent control:

' Note: ctlManageLink is assumed to be a reference to the child control

With ctlManageLink
    .ModuleConfiguration = Me.ModuleConfiguration
    .LocalResourceFile = Me.LocalResourceFile
End With

The above allows the child control to use the parent's ModuleConfiguration (which will include ModuleId) and LocalResourceFile for any localization.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
3/16/2009 5:51 AM
 

thank you, this works !!!

 
New Post
10/5/2012 9:25 AM
 
Hi all ,

How to get Module id to dynamically created user control on view control .............
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...DNN 5 - ModuleId and TabId always -1 in nested controlDNN 5 - ModuleId and TabId always -1 in nested 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