예제 #1
0
        private static void PageLoadHandler(object sender, EventArgs e)
        {
            WebUtility.LoadConfigPageContent(true);

            if (((Page)sender).IsPostBack)
            {
                AutoEncryptControlValueHelper.DecryptControlsValue(
                    ConfigSectionFactory.GetPageExtensionSection().AutoEncryptControlIDs.Split(new char[] { ',', ';' },
                                                                                               StringSplitOptions.RemoveEmptyEntries), (Page)sender);
            }
        }
예제 #2
0
        private void page_PreRenderComplete(object sender, EventArgs e)
        {
            RegisterDefaultNameTable();

            AutoEncryptControlValueHelper.EncryptControlsValue(
                ConfigSectionFactory.GetPageExtensionSection().AutoEncryptControlIDs.Split(new char[] { ',', ';' },
                                                                                           StringSplitOptions.RemoveEmptyEntries), (Page)sender);

            PerformanceMonitorHelper.GetDefaultMonitor().WriteExecutionDuration("PageContentModule-RecursiveTranslate",
                                                                                () => TranslatorControlHelper.RecursiveTranslate((Page)sender));

            DeluxeNameTableContextCache.Instance.RegisterNameTable((Page)sender);

            ((Page)sender).ClientScript.RegisterClientScriptBlock(this.GetType(), "DeluxeApplicationPath",
                                                                  string.Format("var _DeluxeApplicationPath = \"{0}\";", HttpContext.Current.Request.ApplicationPath), true);
        }
예제 #3
0
        /// <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);
                }
            }
        }