zoukankan      html  css  js  c++  java
  • asp.net 后台调用confirm

    using System;
    using System.Web.UI;

    public partial class _Default : System.Web.UI.Page, IPostBackEventHandler
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                ScriptManager.RegisterStartupScript(this, this.GetType(), "confirm",
                    "if(confirm('你确定1+1=2吗?'))" + this.ClientScript.GetPostBackEventReference(this, "确定") + "; else " +
                    this.ClientScript.GetPostBackEventReference(this, "不确定"), true);
        }

        public void RaisePostBackEvent(string eventArgument)
        {
            string res;
            switch (eventArgument)
            {
                case "确定":
                    res = "太有才了!";      //处理各种后台任务
                    break;
                case "不确定":
                    res = "是块当实习生的料。";     //处理各种后台任务
                    break;
                default:
                    throw new NotSupportedException();
            }
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('" + res + "');", true);
        }
    }

  • 相关阅读:
    pyecharts学习
    反爬
    pandas
    用 pymongo 操作 MongoDB 数据库
    数据库隔离级别---读未提交,读已提交,重复读,序列化
    vscode 配置c++和python编译和调试环境
    sublime Text3 配置c++编译环境并设置快捷键
    GIT学习笔记
    redis单节点部署
    二元多项式求逆中的小坑
  • 原文地址:https://www.cnblogs.com/linyijia/p/3458185.html
Copyright © 2011-2022 走看看