Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7917861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:17:59+00:00 2026-06-03T15:17:59+00:00

I have build a module in DotNetNuke 6 that contains multiple module definitions. A

  • 0

I have build a module in DotNetNuke 6 that contains multiple module definitions. A module can be added on multiple pages (tabs) and multiple module can be added to one page (tab).
Problem is that I can’t find an identifier that ties all my module definitions together from one instance.

DesktopModuleId is only unique for every module installed (not per instance and page).

ModuleId is unique for every module instance and definition.

TabModuleId is unique for every module instance and tab and definition.

So what I’m looking for is a way to identify which module definitions belong to each other the moment I put a module on the page.

I found a forum post which explains the same problem and someone suggested to look at the ModuleId for every definition and check if they are sequential. I find that very hackies.

Edit:
The module I’m developing contains a number of different definitions, but let’s say we have 3 (view, edit and settings). When I install the module I have to set a category I’m gonna use for the module, say I want it to be a blog module. All 3 definitions will then get data from the database with their same unique id (supposedly). Now I install again the same module, I want to choose another category (portfolio) and only get that data. The way DNN works now, I can’t separate my blog items from my portfolio items as there’s no way to know that my 3 blog definitions belong to each other and are separate of the other 3 portfolio definitions. I hope this make sense…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T15:18:01+00:00Added an answer on June 3, 2026 at 3:18 pm

    I solved my own question with the code below. It’s not the preferred solution, but I had success using it and it will do until DNN implements a real solution.

    All methods from the Controller class connect a custom table in the database. The code checks for all module definitions if they are on the current page (tab) and not already in the db. If not it will add it to the db combined with a new instance id. If 2 or more of the same modules are added to the page and this code runs later (e.g. update), it will only get the module ids that are sequential (the other module ids will be added later).

    ModuleInstanceId = Controller.GetModuleInstanceId(TabModuleId);
    if (ModuleInstanceId == -1)
    {
        Dictionary<Int32, String> ModuleInstanceDefinitions = new Dictionary<Int32, String>();
        Dictionary<String, ModuleDefinitionInfo> ModuleDefinitions = new ModuleController().GetModule(ModuleId).DesktopModule.ModuleDefinitions;
        foreach (ModuleDefinitionInfo ModuleDefinition in ModuleDefinitions.Values)
        {
            List<ModuleInfo> Modules = new ModuleController().GetModulesByDefinition(PortalId, ModuleDefinition.FriendlyName).ToList<ModuleInfo>();
            foreach (ModuleInfo Module in Modules)
            {
                if (Module.TabID == TabId)
                {
                    if (Controller.GetModuleInstanceId(Module.TabModuleID) == -1 || Controller.GetModuleInstanceId(ModuleDefinition.FriendlyName) == -1)
                    {
                        ModuleInstanceDefinitions.Add(Module.TabModuleID, ModuleDefinition.FriendlyName);
                    }
                }
            }
        }
    
        // Probably shouldn't be more then specified in the manifest;
        // Only situatie this could occure is when the module is added to a page twice at the same page;
        ModuleInstanceDefinitions = ModuleInstanceDefinitions.OrderBy(ModuleDefinition => ModuleDefinition.Key).Take(ModuleDefinitions.Count).ToDictionary(Item => Item.Key, Item => Item.Value);
    
        ModuleInstanceId = Controller.SetModuleInstances(ModuleInstanceDefinitions);
    }
    

    Hopefully someone will find this useful or DNN will add it in the source 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to build an application using Maven for PHP that has multiple modules.
I have a multi-module maven build that requires a profile to be activated only
HI, I'm working on DotNetNuke 5 module that basically consists of three pages; step
I have to build a custom module in which i have added a custom
I have a Maven build with three modules. Module A exports a jar. Module
I have a project that comprises pre-build Dll modules, built some time in the
I have build C# program that work with RAPI (communication to PPC or WinCE)
I have part of a build process that creates a hideously long paths in
As an assignment for my C++ module, I have to build a text-adventure game.
I am using Ant 1.8 I have multiple modules in intelliJ IDEA. Each module

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.