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.0Problem retrieving module settingsProblem retrieving module settings
Previous
 
Next
New Post
3/10/2008 7:00 PM
 

Aight, I think I figured it out, but I'm not sure why this is happening.

My module's development is the classic large contrainer ascx control with smaller ascx controls loaded dynamically into it.

ModuleID and other module level values are available to the large contrainer ascx, but are not available to the smaller controls loaded into it.

This became quite obvious when ModuleID returned -1 from within one of these smaller controls.

So I guess either one of two things are happening. Either this behavior is by design and I just have to add support code to fix it, or I'm not properly inheriting.

Either way, now that I have the ModuleID, I can call up the settings manually, but it doesn't feel right, so I'm hoping someone can point out examples of the "proper" approach.

 
New Post
3/10/2008 9:42 PM
 

After looking at your code when I returned to my computer this evening and not finding anything amiss, I came to the conclusion that the module's Settings hashtable was not getting populated for some reason - glad you found out why.

Assuming that your "small" controls which your "large container" control loads also inherit from PortalModuleBase, you will need to initialize the "small" control's ModuleConfiguration property to that of the container module. This will serve (among other things) to pass the container's ModuleId and TabModuleId into the "small" control. Once the parent's ModuleConfiguration is available, the child's Settings hashtable should get loaded automatically the first time it is accessed in code. If you are using localization, you may also want the child control to draw its localized key-value pairs from the same .resx as the parent.  Typical code will be similar to:

Dim ctl As Control = LoadControl (ctlPath)
If ctl Is Nothing Then
    'Handle error - could not load control
Else
    With CType(ctl, DotNetNuke.Entities.Modules.PortalModuleBase)
          .ModuleConfiguration = Me.ModuleConfiguration
          .LocalResourceFile = Me.LocalResourceFile
    End With
End If


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
4/7/2008 11:59 AM
 

I need to be clear. If you do use the newer SynchronizeModule method, do you use

DotNetNuke.Entities.Modules.ModuleController.SynchronizeModule(ModuleId)

or do you use

DotNetNuke.Entities.Modules.ModuleController.SynchronizeModule(TabModuleId)

 
New Post
4/7/2008 12:21 PM
 

That would be ModuleId.  Also take note that the ModuleController.SynchronizeModule(ByVal ModuleId as Integer) method was introduced in DNN version 04.06.xx or so. If your module needs to be compatible with an earlier version of DNN you will have to use the now deprecated Modules.PortalModuleBase.SynchronizeModule() method. I found this out the hard way when I released a module claiming compatibility with DNN 04.05.05.


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
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Problem retrieving module settingsProblem retrieving module settings


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