Search code examples
c#htmldotnetnukednn9

How can I import an existing DNN module into a new module without copying the existing code?


I would like to create a new module which will have two dropdown menu's in the settings whereby it will get the moduleID of two other modules that is already installed on DNN.

How would I "import" these modules into a new module without having to copy the code? I would like to hide the view of these two modules until someone clicks on a button to show them in a pop-up.

UPDATE

This is the original question of what I would like to achieve: How to show a DNN module in a Fancybox pop up?


Solution

  • Here you go. A snippet to get the Portal Modules.

    var allModules = DesktopModuleController.GetPortalDesktopModules(PortalId);
    
    foreach (var module in allModules)
    {
        var moduleInfo = module.Value; //because allModules is a List<KeyValuePair>
    
        Label1.Text += moduleInfo.DesktopModuleID + " - " + moduleInfo.FriendlyName + "<br>";
    }