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?
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.
One thing to watch out for when passing a null TabId to GetModule is that if you have a module that's installed on a number of different tabs, you'll be getting the first one back, so the values for TabId, TabModuleId and ModuleOrder will be based on that first instance, which may or may not be the instance you wanted.
HTH,
Don
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With