Listmodules = new List (); modules = (List )ModuleController.Instance.GetTabModules(tabId); foreach (ModuleInfo module in modules) { Console.WriteLine(module.ModuleTitle); }
ListIn this example, we retrieve all modules of a specific type ("MyModule") on a specific tab using the GetTabModules method with some LINQ. We first create a new List of ModuleInfo objects. Next, we use the Where extension method with a lambda expression to filter the collection of modules by the FriendlyName of the associated desktop module. Finally, we iterate through the resulting collection of modules and print the title of each module to the console. Package library: DotNetNuke.Entities.Modules.modules = new List (); modules = (List )ModuleController.Instance.GetTabModules(tabId).Where(m => m.DesktopModule.FriendlyName == "MyModule").ToList(); foreach (ModuleInfo module in modules) { Console.WriteLine(module.ModuleTitle); }