示例#1
0
 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>");
 }
示例#2
0
 /// <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>");
 }
示例#3
0
 /// <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>");
 }
示例#4
0
    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);
    }
示例#5
0
 /// <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>");
 }
示例#6
0
 /// <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);
 }
示例#7
0
 /// <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);
 }
示例#8
0
 public static void AlertMessage(System.Web.UI.Page pg, string header, string Message)
 {
     pg.ClientScript.RegisterStartupScript(pg.GetType(), "swal(" + header + ", " + Message + ");", Message, true);
 }
示例#9
0
 /// <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>");
 }
示例#10
0
 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);
 }
示例#11
0
        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;
            }
        }
示例#12
0
 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>");
 }
示例#13
0
 public static void MessageBoxShow(this System.Web.UI.Page page, string msg)
 {
     page.ClientScript.RegisterStartupScript(page.GetType(), "alert", "<script>alert('" + msg + "')</script>");
 }
示例#14
0
 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>");
 }
示例#15
0
 public static void Show(System.Web.UI.Page page, string message)
 {
     page.ClientScript.RegisterClientScriptBlock(page.GetType(), "msg", "BootstrapDialog.alert(\"" + message + "\");", true);
 }
示例#16
0
文件: Util.cs 项目: icaroferj/ir-api
 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);
 }
示例#17
0
 public static void MessageBoxShow(System.Web.UI.Page page, string msg)
 {
     page.ClientScript.RegisterStartupScript(page.GetType(), "message",
                                             string.Format("<script>alert('{0}')</script>", msg));
 }
示例#18
0
文件: Util.cs 项目: icaroferj/ir-api
 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>");
 }
示例#19
0
 /// <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);
 }
示例#21
0
 /// <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);
 }
示例#22
0
 /// <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>");
 }
示例#23
0
 public static void AlertMsg(System.Web.UI.Page page, string msg)
 {
     page.ClientScript.RegisterClientScriptBlock(page.GetType(), "kk", "<script>alert('" + msg + "')</script>");
 }
示例#24
0
 /// <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>");
 }
示例#25
0
 /// <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>");
 }
示例#26
0
 public static void alert(System.Web.UI.Page page, object _code)
 {
     page.ClientScript.RegisterStartupScript(page.GetType(), "onLoad", "<script language='javascript'>" + _code + "</script>");
 }
示例#27
0
 public static void alert(string msg, System.Web.UI.Page page)
 {
     System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "text", "alert('" + msg.Replace("'", "") + "')", true);
 }
示例#28
0
 public static void ShowSuccess(System.Web.UI.Page page, string message, string redirectUrl)
 {
     page.ClientScript.RegisterClientScriptBlock(page.GetType(), "msg", "ShowSuccessDialog(\"" + message + "\",\"" + redirectUrl + "\");", true);
 }
示例#29
0
 /// <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>");
 }
示例#30
0
        /// <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);
        }