private HtmlAnchor GetPageLinkByTitleFromSemanticNavigation(string cssClass, string pageTitle, bool isParentPage = true) { HtmlControl nav = null; if (isParentPage) { nav = this.EM.Navigation.NavigationWidgetFrontend.GetSemanticNavigation(cssClass); } else { nav = this.EM.Navigation.NavigationWidgetFrontend.GetSemanticNavigationChild(cssClass); } nav.AssertIsNotNull("Navigation"); HtmlAnchor link = nav.ChildNodes.Where(n => n.InnerText.Contains(pageTitle)).FirstOrDefault().As <HtmlAnchor>(); if (link == null || !link.IsVisible()) { throw new ArgumentNullException("Link not found"); } else { return(link); } }