Esempio n. 1
0
        private static void RequireWindowCommandScript()
        {
            WebUtility.RequiredScript(typeof(DeluxeScript));
            string script = string.Format("$HGRootNS.WindowCommand.set_commandInputID('{0}');", DeluxeScript.C_CommandIputClientID);

            script = DeluxeClientScriptManager.AddScriptTags(script);
            Page page = WebUtility.GetCurrentPage();

            page.ClientScript.RegisterStartupScript(page.GetType(), "RequireWindowCommandScript", script);
        }
Esempio n. 2
0
        /// <summary>
        /// 直接Response出刷新父页面脚本
        /// </summary>
        /// <param name="response">HttpResponse对象</param>
        public static void WriteRefreshParentWindowScriptBlock(this HttpResponse response)
        {
            if (response != null)
            {
                HttpContextExtension.ResponseRequireWindowCommandScriptBlock();

                string script = DeluxeClientScriptManager.AddScriptTags("$HGRootNS.WindowCommand.openerExecuteCommand(\"refresh\");");

                response.Write(script);
            }
        }
Esempio n. 3
0
        internal static void ResponseRequireWindowCommandScriptBlock()
        {
            StringBuilder strB = new StringBuilder();

            strB.Append(WebUtility.GetRequiredScript(typeof(DeluxeScript)));
            strB.Append("\n");
            string script = string.Format("$HGRootNS.WindowCommand.set_commandInputID('{0}');", DeluxeScript.C_CommandIputClientID);

            strB.Append(DeluxeClientScriptManager.AddScriptTags(script));
            strB.Append("\n");

            ResponseString(HttpContext.Current, RequireWindowCommandScriptKey, strB.ToString());
        }
Esempio n. 4
0
        /// <summary>
        /// Response客户端弹出错误框
        /// </summary>
        /// <param name="response">HttpResponse对象</param>
        /// <param name="strMessage">错误框消息</param>
        /// <param name="strDetail">错误框详细信息</param>
        /// <param name="strTitle">错误框Title</param>
        public static void WriteShowClientErrorScriptBlock(this HttpResponse response, string strMessage, string strDetail, string strTitle)
        {
            if (response != null)
            {
                HttpContextExtension.ResponseClientMessageCommonScriptBlock();

                if (WebAppSettings.AllowResponseExceptionStackTrace() == false)
                {
                    strDetail = string.Empty;
                }

                string script = ScriptHelper.GetShowClientErrorScript(strMessage, strDetail, strTitle);

                script = DeluxeClientScriptManager.AddScriptTags(script);

                WebApplicationExceptionExtension.TryWriteAppLog(strMessage, strDetail);

                response.Write(script);
            }
        }