Skip to content

Instantly share code, notes, and snippets.

@tiagosalgado
Created September 22, 2017 08:11
Show Gist options
  • Save tiagosalgado/d643c31ccb3d3de3347671fc87eb2b95 to your computer and use it in GitHub Desktop.
Save tiagosalgado/d643c31ccb3d3de3347671fc87eb2b95 to your computer and use it in GitHub Desktop.
Navigate between modules on DotNetNuke
var tabController = new DotNetNuke.Entities.Tabs.TabController().GetTabsByPortal(this.PortalId);
var tab = tabController
.Where(t => string.Equals(t.Value.TabName,"ModuleFriendlyName", StringComparison.InvariantCultureIgnoreCase))
.FirstOrDefault();
if (!tab.Equals(default(KeyValuePair<int, DotNetNuke.Entities.Tabs.TabInfo>)))
{
var childModules = tab.Value.ChildModules
.Where(p => string.Equals(p.Value.DesktopModule.FriendlyName,"ModuleFriendlyName", StringComparison.InvariantCultureIgnoreCase))
.FirstOrDefault();
var url = Globals.NavigateURL(
tab.Value.KeyID, // TabID
"MoreStuffKey", // ControlKey
"mid",
childModules.Value.ModuleID.ToString()
);
Response.Redirect(url);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment