private static HtmlHead BuildHtmlHeadControl(this XhtmlDocument xhtmlDocument, IXElementToControlMapper controlMapper) { var headControl = new HtmlHead(); xhtmlDocument.MergeToHeadControl(headControl, controlMapper); return(headControl); }
private void MergeHeadSection(XhtmlDocument xhtmlDocument, HtmlHead headControl, IXElementToControlMapper controlMapper) { xhtmlDocument.MergeToHeadControl(headControl, controlMapper); // handling custom master page head control locally - removing it if a generic meta description tag was in the document if (headControl.Controls.OfType <HtmlMeta>().Any(f => f.Name == "description")) { var existingDescriptionMetaTag = headControl.Controls.OfType <DescriptionMetaTag>().FirstOrDefault(); if (existingDescriptionMetaTag != null) { headControl.Controls.Remove(existingDescriptionMetaTag); } } }