/// <summary> /// 获取PageExtensionSection /// </summary> /// <returns></returns> public static PageContentSection GetPageExtensionSection() { PageContentSection section = (PageContentSection)ConfigurationBroker.GetSection("deluxe.web/pageContent"); if (section == null) section = new PageContentSection(); return section; }
/// <summary> /// 获取PageExtensionSection /// </summary> /// <returns></returns> public static PageContentSection GetPageExtensionSection() { PageContentSection section = (PageContentSection)ConfigurationBroker.GetSection("deluxe.web/pageContent"); if (section == null) { section = new PageContentSection(); } return(section); }
/// <summary> /// 向页面添加配置扩展信息 /// </summary> public static void LoadConfigPageContent(bool checkAutoLoad) { PageContentSection section = ConfigSectionFactory.GetPageExtensionSection(); Page page = GetCurrentPage(); if (checkAutoLoad) { if (!section.AutoLoad) { return; } if (page.Header == null) { return; } string headerAutoLoad = page.Header.Attributes["autoLoad"]; if (headerAutoLoad.IsNotEmpty() && headerAutoLoad.ToLower() == "false") { return; } } foreach (FilePathConfigElement cssElm in section.CssClasses) { string path = cssElm.Path; if (path != string.Empty) { ClientCssManager.RegisterHeaderEndCss(page, path); } } foreach (FilePathConfigElement scriptElm in section.Scripts) { string path = scriptElm.Path; if (path != string.Empty) { DeluxeClientScriptManager.RegisterHeaderEndScript(page, path); } } }