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...Administration ...Administration ...QUERY: Dynamic load/destroy DNN modules... woes..QUERY: Dynamic load/destroy DNN modules... woes..
Previous
 
Next
New Post
4/20/2006 11:31 AM
 
I am interested in this "Dynamic Loading Modules" from:

http://opensource.indyneinc.com/home/DevX/Articles/DynamicLoadUserControlsinDotNetNuke3/tabid/67/Default.aspx

which lets you load up DNN modules dynamically. However it was written for DNN3. How easy would it be to get it working for DNN4?

Or does DNN4 already have functionality to dynamically load/destroy DNN modules?
 
New Post
4/20/2006 12:06 PM
 
usually all DNN 3 modules run in DNN 4 (but not vice versa).

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
4/20/2006 7:07 PM
 

This technique is similar to one that I have used with good success in a number of DNN 3 and 4 modules. Note however, that the author is not describing a means of dynamically loading DNN modules (which is what DNN itself does) but rather a module that dynamically loads user controls (.ascx) to change its presentation of data, user interface, etc.  For example on one site (http://www.ctamaine.org) I have several instances of the same module - one showing a datagrid of community access centers, another access center e-mail address, and another of access center websites. The main module (loaded by DNN) includes methods for searching and loading data from the database and for testing user permissions. Then, depending on a ViewKey value (stored as a TabModuleSetting), the parent or wrapper module (or switchboard as the article calls it) uses LoadControl to load one or more user controls to present the data in different ways. The primary advantages (as opposed to DNN's use of the module "key" to switch between a module's various controls) are that 1) one needs to write only one module control with its often complex code and then write several (often very simple - sometimes only requiring different .ascx controls but the same code behind) view controls and 2) DNN's default behavior of switching to an admin skin showing only the current module for any module controls having other than the blank "key" is avoided.

If you are interested in doing something similar, here's an important point: each dynamically loaded user control should inherit from either PortalModuleBase or better yet, from your own custom class that inherits from PortalModuleBase.  After the parent module loads its child user control, it should then pass its own ModuleConfiguration object to the child control. This makes it possible for the child to access the same vital information as its parent - ModuleId, ModuleSettings, etc.

Finally, if you're interested in studying this technique further, I have developed the start of a framework for defining and loading what I call ModuleViews which subclasses PortalModuleBase, ModuleSettingsBase and ModuleController; creates DNN database tables that somewhat parallel ModuleDefinitions, ModuleControls, etc. but for ModuleViewDefinitions, ModuleViews, etc.; and during installation of a module with child views parses a Views manifest xml file similar to the DNN module manifest file.  As I'm still having problems with the installation phase due to a lack of reliable "hooks" in the DNN module installer to allow a module developer to run custom code during the module installation process and due to a lack of time to properly document the framework, I consider it more of a work in progress of interest to the experienced developer.  If you would like to take a look at the source code to get better insight into this technique, you're welcome to register at my site (http://www.wesnetdesigns.com) and then download the WESNet DNN Modules Base Install (for DNN 4 only).  The base install also implements PortalModuleSetttings which are truly global across the portal for any instance of a particular module (unlike ModuleSettings and TabModuleSettings).


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...Administration ...Administration ...QUERY: Dynamic load/destroy DNN modules... woes..QUERY: Dynamic load/destroy DNN modules... woes..


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