public static void Alertback(System.Web.UI.Page page, string msg) { page.ClientScript.RegisterStartupScript(page.GetType(), "msg", "<Script language='JavaScript'>alert('" + msg + "');window.history.back()</Script>"); }
/// <summary> /// 输出自定义脚本信息 /// </summary> /// <param name="page">当前页面指针,一般为this</param> /// <param name="script">输出脚本</param> public static void ResponseScript(System.Web.UI.Page page, string script) { page.ClientScript.RegisterStartupScript(page.GetType(), "message", "<script language='javascript' defer>" + script + "</script>"); }
/// <summary> /// 显示消息提示对话框 /// </summary> /// <param name="page">当前页面指针,一般为this</param> /// <param name="msg">提示信息</param> public static void Show(System.Web.UI.Page page, string msg) { page.ClientScript.RegisterStartupScript(page.GetType(), "message", "<script language='javascript' defer>alert('" + msg.ToString() + "');</script>"); }
public static void VerEquipos(System.Web.UI.Page pagina, string videquipo, string vhtipo, string vhequipo, string vformulario) { string wFecha = inicio + id + videquipo + htipo + vhtipo + hequipo + vhequipo + formulario + vformulario + "','', " + atributos + "</script>"; pagina.ClientScript.RegisterStartupScript(pagina.GetType(), "ventana", wFecha); }
/// <summary> /// 注册脚本块 /// </summary> public static void RegisterScriptBlock(System.Web.UI.Page page, string _ScriptString) { page.ClientScript.RegisterStartupScript(page.GetType(), "scriptblock", "<script type='text/javascript'>" + _ScriptString + "</script>"); }
/// <summary> /// 弹出JavaScript小窗口 /// </summary> /// <param name="js">窗口信息</param> public static void Alert(System.Web.UI.Page page, string message) { page.ClientScript.RegisterStartupScript(page.GetType(), "Bangalert", "alert('" + message + "');", true); }
/// <summary> /// 弹出消息框并且转向到新的URL /// </summary> /// <param name="message">消息内容</param> /// <param name="toURL">连接地址</param> public static void AlertAndRedirect(System.Web.UI.Page page, string message, string toURL) { page.ClientScript.RegisterClientScriptBlock(page.GetType(), "Bangalert_redirect", "alert('" + message + "');widow.location.replace('" + toURL + "');", true); }
public static void AlertMessage(System.Web.UI.Page pg, string header, string Message) { pg.ClientScript.RegisterStartupScript(pg.GetType(), "swal(" + header + ", " + Message + ");", Message, true); }
/// <summary> /// 自定义脚本信息 /// </summary> /// <param name="page"></param> /// <param name="msg"></param> public static void AlertLocation(System.Web.UI.Page page, string msg) { page.ClientScript.RegisterStartupScript(page.GetType(), "msg", "<script>" + msg + "</script>"); }
public static void AlertMessage(System.Web.UI.Page ctrl, string strMessage) { //this.ClientScript.RegisterClientScriptBlock(this.GetType(), "msg", "<script>alert('" + strMessage + "');</script>"); System.Web.UI.ScriptManager.RegisterStartupScript(ctrl, ctrl.GetType(), "msg", "alert('" + strMessage + "');", true); }
public static string GetMsg(System.Web.UI.Page pg, string msgFor, string msgType) { string strMsg = ""; try { switch (msgType) { case "EE": strMsg = "swal({ title: \"Opps!!\", text: \"Query Name Already Exists\", icon: \"error\", button: \"Ok\",});"; break; case "LE": strMsg = "swal({ title: \"Opps!!\", text: \"Please Select atleast one Column.\", icon: \"error\", button: \"Ok\",});"; break; case "I": strMsg = "swal({ title: \"Done\", text: \"Record Saved Successfully\", icon: \"success\", button: \"Ok\",});"; break; case "P": strMsg = "swal({ title: \"Done\", text: \"Payment Verified Successfully\", icon: \"success\", button: \"Ok\",});"; break; case "IA": strMsg = "swal({ title: \"Alert\", text: \"Please Enter Valid Application Number.\", icon: \"error\", button: \"Ok\",});"; break; case "U": strMsg = "swal({ title: \"Done\", text: \"Record Updated Successfully\", icon: \"success\", button: \"Ok\",});"; break; case "D": strMsg = "swal({ title: \"Done\", text: \"Record Deleted Successfully\", icon: \"success\", button: \"Ok\",});"; break; case "IP": strMsg = "swal({ title: \"Done\", text: \"Incorrect Password\", icon: \"warning\", button: \"Ok\",});"; break; case "IE": strMsg = "swal({ title: \"Error\", text: \"Record Can't Be Saved\", icon: \"error\", button: \"Ok\",});"; break; case "UE": strMsg = "swal({ title: \"Error\", text: \"Record Can't Be Updated\", icon: \"error\", button: \"Ok\",});"; break; case "DE": strMsg = "swal({ title: \"Error\", text: \"Record Can't Be Deleted\", icon: \"error\", button: \"Ok\",});"; break; case "AE": strMsg = "swal({ title: \"Alert\", text: \"Record Already Exists\", icon: \"warning\", button: \"Ok\",});"; break; case "PE": strMsg = "swal({ title: \"Alert\", text: \"Payment Already verified\", icon: \"warning\", button: \"Ok\",});"; break; case "CF": strMsg = "swal({ title: \"Error\", text: \"Record Can't Be Deleted Due To Dependency\", icon: \"error\", button: \"Ok\",});"; break; case "ANC": strMsg = "swal({ title: \"Done\", text: \"Enter Only One Record.\", icon: \"warning\", button: \"Ok\",});"; break; case "CED": strMsg = "swal({ title: \"Error\", text: \"Record Can't Be Edited or Deleted Due To Dependency\", icon: \"error\", button: \"Ok\",});"; break; case "UR": strMsg = "swal({ title: \"Error\", text: \"Does not have rights for update.\", icon: \"error\", button: \"Ok\",});"; break; case "SR": strMsg = "swal({ title: \"Opps!!\", text: \"Does not have rights for insert\", icon: \"error\", button: \"Ok\",});"; break; case "AU": strMsg = "swal({ title: \"Error\", text: \"Record Dependency Error.\", icon: \"error\", button: \"Ok\",});"; break; case "UV": strMsg = "swal({ title: \"Done\", text: \"Status Verified Successfully\", icon: \"success\", button: \"Ok\",});"; break; case "UAV": strMsg = "swal({ title: \"Alert\", text: \"Some of the Applicant(s) are already Verified.\", icon: \"success\", button: \"Ok\",});"; break; case "UUn": strMsg = "swal({ title: \"Done\", text: \"Status UnVerified Successfully\", icon: \"success\", button: \"Ok\",});"; break; case "UAUn": strMsg = "swal({ title: \"Alert\", text: \"You can't Unverified because Some Applicant(s) are Eligible or Enrolled.\", icon: \"success\", button: \"Ok\",});"; break; case "SD": strMsg = "swal({ title: \"Opps!!\", text: \"Please select record which you want to Delete.\", icon: \"error\", button: \"Ok\",});"; break; case "FND": strMsg = "swal({ title: \"Opps!!\", text: \"Fees not defined.\", icon: \"error\", button: \"Ok\",});"; break; case "MFV": strMsg = "swal({ title: \"Opps!!\", text: \"Invalid Merit Formula.\", icon: \"error\", button: \"Ok\",});"; break; case "MFIV": strMsg = "swal({ title: \"Opps!!\", text: \"Please Enter All Selected Identifier in Merit Formula.\", icon: \"error\", button: \"Ok\",});"; break; case "MFID": strMsg = "swal({ title: \"Opps!!\", text: \"Please Select Unique Identifier.\", icon: \"error\", button: \"Ok\",});"; break; case "QRIK": strMsg = "swal({ title: \"Opps!!\", text: \"Entered Kit Details are not Valid.\", icon: \"error\", button: \"Ok\",});"; break; case "Weightage": strMsg = "swal({ title: \"Opps!!\", text: \"Total weightage for all the selected qualifying head in a formula must be equal to 1.00. or If no weightage is applicable, all the selected qualifying head in a formula must have weightage of 1.00 \", icon: \"error\", button: \"Ok\",});"; break; case "APFREEZE": strMsg = "swal({ title: \"Alert\", text: \"Selected Admission Process is Freeze. Kindly UnFreeze in order to make changes.\", icon: \"error\", button: \"Ok\",});"; break; case "Send": strMsg = "swal({ title: \"Done\", text: \"SMS Send Successfully\", icon: \"success\", button: \"Ok\",});"; break; case "Email": strMsg = "swal({ title: \"Done\", text: \"Email Send Successfully\", icon: \"success\", button: \"Ok\",});"; break; case "DR": strMsg = "swal({ title: \"Opps!!\", text: \"You does not have rights to perform this delete activity.\", icon: \"error\", button: \"Ok\",});"; break; case "VR": strMsg = "swal({ title: \"Opps!!\", text: \"You does not have rights to perform this view activity.\", icon: \"error\", button: \"Ok\",});"; break; case "RE": strMsg = "swal({ title: \"Alert\", text: \"Record Already Exists for Selected Parameter kindly Complete the Round. \", icon: \"warning\", button: \"Ok\",});"; break; case "MR": strMsg = "swal({ title: \"Alert\", text: \"Mock Round Already Exists. \", icon: \"warning\", button: \"Ok\",});"; break; case "DC": strMsg = msgFor; break; default: strMsg = "swal({ title: \"Information\", text: \" " + msgFor + " \", icon: \"info\", button: \"Ok\",});"; break; } pg.ClientScript.RegisterStartupScript(pg.GetType(), "alert", strMsg, true); return(strMsg); } catch (Exception ex) { throw ex; } }
public static void MessageBoxShowAndRedirect(this System.Web.UI.Page page, string msg, string url) { page.ClientScript.RegisterStartupScript(page.GetType(), "alert", "<script>alert('" + msg + "');window.location.href =" + url + ";</script>"); }
public static void MessageBoxShow(this System.Web.UI.Page page, string msg) { page.ClientScript.RegisterStartupScript(page.GetType(), "alert", "<script>alert('" + msg + "')</script>"); }
public static void AlertAndRedirect(System.Web.UI.Page page, string msg, string toUrl) { page.ClientScript.RegisterStartupScript(page.GetType(), "msg", "<Script language='JavaScript'>alert('" + msg + "');window.location.replace('" + toUrl + "')</Script>"); }
public static void Show(System.Web.UI.Page page, string message) { page.ClientScript.RegisterClientScriptBlock(page.GetType(), "msg", "BootstrapDialog.alert(\"" + message + "\");", true); }
public static void AjaxAlertJS(System.Web.UI.Page page, string msg) { System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), Guid.NewGuid().ToString(), "alert('" + msg + "');", true); }
public static void MessageBoxShow(System.Web.UI.Page page, string msg) { page.ClientScript.RegisterStartupScript(page.GetType(), "message", string.Format("<script>alert('{0}')</script>", msg)); }
public static void RedirectJS(System.Web.UI.Page pagina, string url) { //pagina.RegisterStartupScript("x", "<script>window.parent.content.location.href = " + url + "</script>"); pagina.ClientScript.RegisterStartupScript(pagina.GetType(), "x", "<script>window.location.href = '" + url + "';</script>"); }
/// <summary> /// 执行页面JS /// </summary> /// <param name="page"></param> /// <param name="jsString"></param> public static void ExecuteJS(System.Web.UI.Page page, string jsString) { page.ClientScript.RegisterStartupScript(page.GetType(), "BangJS", jsString, true); }
public static void MessageBox(System.Web.UI.Page page, string strMsg) { //+ character added after strMsg "')" ScriptManager.RegisterClientScriptBlock(page, page.GetType(), "alertMessage", "alert('" + strMsg + "')", true); }
/// <summary> /// 回到历史页面 /// </summary> /// <param name="value">-1/1</param> public static void GoHistory(System.Web.UI.Page page, int value) { page.ClientScript.RegisterClientScriptBlock(page.GetType(), "Banghistory_go", "history.go('" + value + "')", true); }
/// <summary> /// 弹出对话框 /// </summary> /// <param name="page">页面</param> /// <param name="content">message信息</param> public static void alert(System.Web.UI.Page page, string content) { page.ClientScript.RegisterStartupScript(page.GetType(), " ", "<script language='javascript'>alert('" + content + "');</script>"); }
public static void AlertMsg(System.Web.UI.Page page, string msg) { page.ClientScript.RegisterClientScriptBlock(page.GetType(), "kk", "<script>alert('" + msg + "')</script>"); }
/// <summary> /// 弹出对话框 /// </summary> /// <param name="page">页面</param> /// <param name="content">message信息</param> public static void alert(System.Web.UI.Page page, string content, String _daiMa) { page.ClientScript.RegisterStartupScript(page.GetType(), " ", "<script language='javascript'>alert('" + content + "');" + _daiMa.Replace("\"", "'") + "</script>"); }
/// <summary> /// 在body开始处输出js(将 JavaScript 嵌入到页面中开始元素 form 的紧后面) /// </summary> /// <param name="page">page对象</param> /// <param name="js">js代码</param> public static void AddBodyStart(System.Web.UI.Page page, String js) { page.ClientScript.RegisterClientScriptBlock(page.GetType(), Guid.NewGuid().ToString(), @"<script type='text/javascript' >" + js + "</script>"); }
public static void alert(System.Web.UI.Page page, object _code) { page.ClientScript.RegisterStartupScript(page.GetType(), "onLoad", "<script language='javascript'>" + _code + "</script>"); }
public static void alert(string msg, System.Web.UI.Page page) { System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "text", "alert('" + msg.Replace("'", "") + "')", true); }
public static void ShowSuccess(System.Web.UI.Page page, string message, string redirectUrl) { page.ClientScript.RegisterClientScriptBlock(page.GetType(), "msg", "ShowSuccessDialog(\"" + message + "\",\"" + redirectUrl + "\");", true); }
/// <summary> /// 显示消息提示对话框,并进行页面跳转 /// </summary> /// <param name="page">当前页面指针,一般为this</param> /// <param name="msg">提示信息</param> /// <param name="url">跳转的目标URL</param> public static void ShowAndRedirect(System.Web.UI.Page page, string msg, string url) { //Response.Write("<script>alert('帐户审核通过!现在去为企业充值。');window.location=\"" + pageurl + "\"</script>"); page.ClientScript.RegisterStartupScript(page.GetType(), "message", "<script language='javascript' defer>alert('" + msg + "');window.location=\"" + url + "\"</script>"); }
/// <summary> /// 使用alert弹出框架来提示内容。(带脚本运行功能) /// </summary> /// <param name="message">提示内容</param> /// <param name="func">确定后,执行的脚本</param> public void AlertFunc(string message, string func = "") { var script = "alert('" + message + "');" + func + ";"; page.Page.ClientScript.RegisterStartupScript(page.GetType(), "System.AlertFunc", script, true); }