Search code examples
asp.net.netdotnetnukedotnetnuke-module

In DotNetNuke, how can I get a ModuleInfo object if I just have a ModuleId (and not a TabId)


The only method provided by the DNN framework to get a module by ID also required a tab ID. What can I do if I don't have a tab ID?


Solution

  • The GetModule method off of the DotNetNuke.Entities.Modules.ModuleController class will accept a "null" value for tab ID if you don't have a tab ID. That is, try the following:

    new ModuleController().GetModule(moduleId, DotNetNuke.Common.Utilities.Null.NullInteger)
    

    See also my blog post on the subject.