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.0Module LoadingModule Loading
Previous
 
Next
New Post
10/17/2007 4:34 PM
 

Where is the code that determines if a module is loaded/shown or not?

Thanks

 
New Post
11/8/2007 6:38 PM
 

I am looking for a similar thing. I would like to programmatically load a moduleid in my own ascx control like the skin loads modules into the content pane, right pane etc.

 
New Post
11/8/2007 11:04 PM
 

Although there are a lot of steps involved in loading modules, most of the action takes place in the class DotNetNuke.UI.Skins.Skin, particularly in the Page_Init event handler and the InjectModule method. You'll find this class in the sourcecode in the file Library\Components\Skins\Skin.vb. You'll also want to look at a number of the classes in the Library\Components\Modules folder and get a feel for what information is stored in the module and tab related tables in the database - particularly ModuleDefinitions, DesktopModules, Modules, Tabs, and TabModules.


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/9/2007 3:42 PM
 

Thank you. I did not find it since I was not looking in the library. Thanks for that! I have found next code.
I would like to discuss a bit before starting programming.

If Not parent Is Nothing Then
'try to localize admin modules
If PortalSettings.ActiveTab.IsAdminTab Then
objModule.ModuleTitle = Localization.LocalizeControlTitle(objModule.ModuleTitle, objModule.ControlSrc, "")
End If

'try to inject the module into the skin
Try
InjectModule(parent, objModule, PortalSettings)
Catch ex As Exception
bSuccess = False
End Try
Else             ' no ContentPane in skin
Dim lex As ModuleLoadException
lex = New ModuleLoadException(PANE_LOAD_ERROR)
Controls.Add(New ErrorContainer(PortalSettings, MODULELOAD_ERROR, lex).Container)
LogException(lex)
Err.Clear()
End If

So after checking the security you can do:  InjectModule(parent, objModule, PortalSettings)

I can across next post: http://forums.asp.net/p/871887/879195.aspx
But seems that those guys hook off since it did not work.

I have next pseudo code:

//PortalModuleBase
int dbModuleId = -1; //to be defined yet.
int dbTabId = -1; //to be defined yet

Skin skin = (Skin)Parent;
ModuleController moduleController = new ModuleController();
ModuleInfo objModule = moduleController.GetModule(dbModuleId, dbTabId);
skin.InjectModule(this, objModule, PortalSettings);

I am wondering if this is the correct approach.
Looks to me that I do not know for sure where it will dynamically load this module now. ??
If somebody can give me some more help that would be appreciated.

J.

 
New Post
11/9/2007 4:42 PM
 

This is the approach:

            int dbTabId = 471; //to be defined yet
            int dbModuleId = 1007; //to be defined yet.

            Skin skin = Skin.GetParentSkin(this);
            ModuleController moduleController = new ModuleController();           
            ModuleInfo objModule = moduleController.GetModule(dbModuleId, dbTabId);
            //objModule.TabID = dbTabId;
            //objModule.ModuleID = dbModuleId;
            skin.InjectModule(this, objModule, PortalSettings);

Only problem is that the red box : no view by users is visible. So only the admin sees the module. How can I fix this?

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Module LoadingModule Loading


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