Exemple #1
0
        ///// <summary>
        ///// 是否独占的脚本,将禁止页面元素的渲染
        ///// </summary>
        ///// <param name="scriptContent"></param>
        //public static void RegisterExclusiveScript(string scriptContent)
        //{
        //    Page page = HttpContext.Current.CurrentHandler as Page;
        //    if (page != null)
        //    {
        //        ResourceManager.Instance.SetExclusiveScript(scriptContent);
        //    }

        //}

        //public static void RegisterStartupScript(string scriptContent, bool preRegister)
        //{
        //    if (preRegister)
        //    {
        //        RegisterStartupScript(scriptContent, -100);
        //    }
        //    else
        //    {
        //        RegisterStartupScript(scriptContent);
        //    }
        //}

        ///// <summary>
        ///// 注册页面加载后的JS脚本
        ///// Level 层次(层次越高,注册越靠后)(缺省100),负值表示在所有注册脚本之前执行
        ///// </summary>
        ///// <param name="page"></param>
        ///// <param name="scriptContent"></param>
        //public static void RegisterStartupScript(string scriptContent, int level)
        //{
        //    Page page = HttpContext.Current.CurrentHandler as Page;
        //    if (page != null)
        //    {
        //        ResourceManager.Instance.AddAbsoluteStartupScript(scriptContent, level);
        //    }
        //}

        #endregion

        /// <summary>
        /// 注册页面脚本
        /// </summary>
        /// <param name="scriptContent">客户端脚本</param>
        public static void RegisterStartupScript(string scriptContent)
        {
            ResourceManager manager = ResourceManager.Instance;

            if (manager.IsFineUIAjaxPostBack)
            {
                manager.AjaxAbsoluteScriptList.Add(scriptContent);
            }
            else
            {
                manager.AddAbsoluteStartupScript(scriptContent);
            }
        }
Exemple #2
0
        ///// <summary>
        ///// 是否独占的脚本,将禁止页面元素的渲染
        ///// </summary>
        ///// <param name="scriptContent"></param>
        //public static void RegisterExclusiveScript(string scriptContent)
        //{
        //    Page page = HttpContext.Current.CurrentHandler as Page;
        //    if (page != null)
        //    {
        //        ResourceManager.Instance.SetExclusiveScript(scriptContent);
        //    }

        //}

        //public static void RegisterStartupScript(string scriptContent, bool preRegister)
        //{
        //    if (preRegister)
        //    {
        //        RegisterStartupScript(scriptContent, -100);
        //    }
        //    else
        //    {
        //        RegisterStartupScript(scriptContent);
        //    }
        //}

        ///// <summary>
        ///// 注册页面加载后的JS脚本
        ///// Level 层次(层次越高,注册越靠后)(缺省100),负值表示在所有注册脚本之前执行
        ///// </summary>
        ///// <param name="page"></param>
        ///// <param name="scriptContent"></param>
        //public static void RegisterStartupScript(string scriptContent, int level)
        //{
        //    Page page = HttpContext.Current.CurrentHandler as Page;
        //    if (page != null)
        //    {
        //        ResourceManager.Instance.AddAbsoluteStartupScript(scriptContent, level);
        //    }
        //}

        #endregion

        /// <summary>
        /// 注册页面脚本
        /// </summary>
        /// <param name="scriptContent">客户端脚本</param>
        public static void RegisterStartupScript(string scriptContent)
        {
            //Page page = HttpContext.Current.CurrentHandler as Page;
            //if (page != null)
            //{
            //    ResourceManager.Instance.AddAbsoluteStartupScript(scriptContent);
            //}
            ResourceManager manager = ResourceManager.Instance;

            if (manager.IsFineUIAjaxPostBack)
            {
                manager.AjaxAbsoluteScriptList.Add(scriptContent);
            }
            else
            {
                manager.AddAbsoluteStartupScript(scriptContent);
            }
        }