public void SuppressPageMenu() { PageMenuControl menu = (PageMenuControl)Master.FindControl("PageMenu1"); if ((menu != null) && (menu.Direction == "Vertical")) { menu.Visible = false; } menu = (PageMenuControl)Master.FindControl("PageMenu2"); if ((menu != null) && (menu.Direction == "Vertical")) { menu.Visible = false; } menu = (PageMenuControl)Master.FindControl("PageMenu3"); if ((menu != null) && (menu.Direction == "Vertical")) { menu.Visible = false; } }
private void CountVisibleMenus() { // Count menus if they exist within a content pane and are visible if ((SiteMenu1 != null) && SiteMenu1.Visible) { // printable view skin doesn't have a menu so it is null there if (SiteMenu1.Parent.ID == "divLeft") { leftModuleCount++; } if (SiteMenu1.Parent.ID == "divRight") { rightModuleCount++; } } Control c = this.FindControl("PageMenu1"); if ( (c != null) && (c.Visible) ) { PageMenuControl p = (PageMenuControl)c; if ((!p.IsSubMenu) || (SiteUtils.TopPageHasChildren(rootNode, p.StartingNodeOffset))) { if (c.Parent.ID == "divLeft") { leftModuleCount++; } if (c.Parent.ID == "divRight") { rightModuleCount++; } } } c = this.FindControl("PageMenu2"); if ( (c != null) && (c.Visible) ) { PageMenuControl p = (PageMenuControl)c; if (SiteUtils.TopPageHasChildren(rootNode, p.StartingNodeOffset)) { if (c.Parent.ID == "divLeft") { leftModuleCount++; } if (c.Parent.ID == "divRight") { rightModuleCount++; } } } c = this.FindControl("PageMenu3"); if ( (c != null) && (c.Visible) ) { PageMenuControl p = (PageMenuControl)c; if (SiteUtils.TopPageHasChildren(rootNode, p.StartingNodeOffset)) { if (c.Parent.ID == "divLeft") { leftModuleCount++; } if (c.Parent.ID == "divRight") { rightModuleCount++; } } } c = this.FindControl("pnlMenu"); if ((c != null) && (c.Parent.ID == "divLeft")) { leftModuleCount++; } c = this.FindControl("StyleSheetCombiner"); if ((c != null) && (c is StyleSheetCombiner)) { StyleSheetCombiner style = c as StyleSheetCombiner; if (style.AlwaysShowLeftColumn) { leftModuleCount++; } if (style.AlwaysShowRightColumn) { rightModuleCount++; } } }