/// <summary> /// 直接Response出刷新父页面脚本 /// </summary> public static void ResponseRefreshParentWindowScriptBlock() { ResponseRequireWindowCommandScriptBlock(); string script = DeluxeClientScriptManager.AddScriptTags("$HGRootNS.WindowCommand.openerExecuteCommand('refresh');"); HttpContext.Current.Response.Write(script); }
/// <summary> /// 直接Response出关闭窗口脚本,然后结束Response /// </summary> public static void ResponseCloseWindowScriptBlock() { ResponseRequireWindowCommandScriptBlock(); string script = DeluxeClientScriptManager.AddScriptTags("$HGRootNS.WindowCommand.executeCommand('close');"); HttpContext.Current.Response.Write(script); HttpContext.Current.Response.End(); }
private static void RequireWindowCommandScript() { RequiredScript(typeof(DeluxeScript)); string script = string.Format("$HGRootNS.WindowCommand.set_commandInputID('{0}');", DeluxeScript.C_CommandIputClientID); script = DeluxeClientScriptManager.AddScriptTags(script); Page page = GetCurrentPage(); page.ClientScript.RegisterStartupScript(page.GetType(), "RequireWindowCommandScript", script); }
/// <summary> /// Response客户端弹出提示框 /// </summary> /// <param name="strMessage">提示框消息</param> /// <param name="strDetail">提示框详细信息</param> /// <param name="strTitle">提示框Title</param> public static void ResponseShowClientMessageScriptBlock(string strMessage, string strDetail, string strTitle) { ResponseClientMessageCommonScriptBlock(); string script = string.Format("$HGRootNS.ClientMsg.inform(\"{0}\", \"{1}\", \"{2}\");", CheckScriptString(strMessage), CheckScriptString(strDetail), CheckScriptString(strTitle)); script = DeluxeClientScriptManager.AddScriptTags(script); HttpContext.Current.Response.Write(script); }
private static void ResponseRequireWindowCommandScriptBlock() { StringBuilder strB = new StringBuilder(); strB.Append(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()); }
/// <summary> /// 获取调整窗口大小和位置脚本 /// </summary> /// <param name="windowFeature"></param> /// <param name="addScriptTags"></param> /// <returns></returns> public static string ToAdjustWindowScriptBlock(this IWindowFeature windowFeature, bool addScriptTags) { string requireScript = WebUtility.GetRequiredScriptBlock(typeof(DeluxeScript)); string clintObject = WindowFeatureHelper.GetClientObject(windowFeature); //string callScript = string.Format("$HGRootNS.WindowFeatureFunction.adjustWindow({0});", clintObject); string callScript = string.Format("$HGRootNS.WindowFeatureFunction.registerAdjustWindow({0});", clintObject); string script = string.Format("{0}\n{1}", requireScript, callScript); if (addScriptTags) { script = DeluxeClientScriptManager.AddScriptTags(script); } return(script); }
/// <summary> /// Response客户端弹出错误框 /// </summary> /// <param name="strMessage">错误框消息</param> /// <param name="strDetail">错误框详细信息</param> /// <param name="strTitle">错误框Title</param> public static void ResponseShowClientErrorScriptBlock(string strMessage, string strDetail, string strTitle) { ResponseClientMessageCommonScriptBlock(); if (AllowResponseExceptionStackTrace() == false) { strDetail = string.Empty; } string script = string.Format("$HGRootNS.ClientMsg.stop(\"{0}\", \"{1}\", \"{2}\");", CheckScriptString(strMessage), CheckScriptString(strDetail), CheckScriptString(strTitle)); script = DeluxeClientScriptManager.AddScriptTags(script); WebApplicationExceptionExtension.TryWriteAppLog(strMessage, strDetail); HttpContext.Current.Response.Write(script); }