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...How to Read Module SettingsHow to Read Module Settings
Previous
 
Next
New Post
10/30/2009 7:01 PM
 

Hi,

I have been looking on how to get access to module configured data, I have a settings page where I save the module settings using ModuleController.UpdateModuleSetting method; but I haven't been able to get/read those values to modify module behavior, I have tried to read using PortalModuleBase.Settings with no luck, what would be the appropiate way to read the configuration in the view?

Thanks.

 
New Post
10/30/2009 8:01 PM
 

Your module control will inherit from PortalModuleBase which provides a Settings property. Settings is a hashtable of combined ModuleSettings and TabModuleSettings keyed by the name of the setting. For example:

In the settings control:

     Dim mc As New DotNetNuke.Entities.Modules.ModuleController
     mc.UpdateModuleSetting(ModuleId, "SortDirection", "ASC")

In the view control:

Dim sortDirection As String = Settings("SortDirection")

Is this the way that you are updating and retrieving your settings? If so and it still is not working have you:

1. Confirmed that the ModuleID being used in the UpdateModuleSetting method matches that of the view control?
2. Confirmed that your ModuleSettings are being properly stored in the DNN ModuleSettings table?

What value is being returned when trying to retrieve a setting - incorrect or null? Is an error being logged?


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
11/2/2009 9:17 AM
 

I see the problem the procedure described is what I am doing to get the settings, however the module is a two step form, where I am trying to get the settings is not the actual view for the module; it is a confirmation form for the same module; therefore, the module id and the settings are not set.

How can I make the second form to get the correct module id?

 

 

 
New Post
11/2/2009 6:51 PM
Accepted Answer 

Is the confirmation "form" another .ascx user control of the same module or is it an .aspx page? In either case you need to pass the ModuleID (as parameter "mid") in the querystring using one of the several overloads of NavigateUrl or EditUrl method to build the url to which you will be redirecting upon completion of the first step. In the former case, your control will inherit from PortalModuleBase and should automatically handle reading the ModuleID from the "mid=<ModuleID>" contained in the querystring. In the second case (which I would avoid if possible) you will have to use your own code to read the ModuleID from the querystring then obtain the ModuleSettings hashtable for that ModuleID. Take a look at the source code for PortalModuleBase to see how that is done.


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
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...How to Read Module SettingsHow to Read 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