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

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Custom Module with Settings PageCustom Module with Settings Page
Previous
 
Next
New Post
4/5/2010 5:59 PM
 

I have created a custom module and I need to store an instance specific variable to drive the behavior of the module. I am created an .ascx file for the View control (inheriting from PortalModuleBase) and a .ascx file for the settings control (inheriting from ModuleSettingsBase). I have added the module via the DNN admin and added the edit view as well however I cannot see the settings control anywhere.

Is there something I need to do to make the settings control visible?

Thanks,

Rob

 

 
New Post
4/5/2010 9:38 PM
 

Please confirm in the module definition that you have registered that the settings control has a Control Key of "Settings".

When you open the module settings from the module's action menu, do you see (at the end of the module settings page) any elements of your custom settings code being rendered? If not and you have verified that the Control Key is correctly registered as above, check the site's event log to see if any errors are being logged when you attempt to open the module's settings page. If no errors are seen, please try placing a debugger break point in the Page_Load handler of your custom settings control to check if the control is being loaded at all.


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/5/2010 10:12 PM
 
I've changed the control key and now I see the .ascx content in the settings. I have examples of how to load and update the settings, but I do not know how to access the settings from the view control. Once I get this small piece I am home free. Any ideas? Thanks, Rob
 
New Post
4/6/2010 8:04 AM
 

Glad you got that part working. To access your module setting from your view control which will inherit from PortalModuleBase, simply access PortalModuleBase property Settings (which is actually of type hashtable) with the key for the particular setting your require. A value of type object will be returned. After checking if the object value is null, it can then be type cast to its actual type. For example, if you have defined a setting with key of "PageSize" and it is of type integer with a default value of 10  and another setting with key of "Category" and it is of type string you can do the following in your view control:

Dim pageSize As Integer = 10
If Settings("PageSize") IsNot Nothing Then TryCast(Settings("PageSize"), pageSize)

Dim category As String = String.Empty
If Settings("Category") IsNot Nothing Then category = CType(Settings("Category"), String)

For modules with many settings I recommend that you create a Configuration class which loads/saves all the settings values and exposes them as strongly typed properties. This greatly simplifies your module code and reduces the chance of misspelling a settings key in either your module settings control or view/edit controls.


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
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Custom Module with Settings PageCustom Module with Settings Page


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