怎样在asp.net(C#)中用 JAVASCRIPT弹出confirm对话框?
如果点击“确定”就执行下列语句,“取消”就退出

解决方案 »

  1.   

    if(confirm("你点布点")){
    alert("你点了")
    }
      

  2.   

    方法很多if(!this.Page.IsPostBack)
    {
      this.button1.Attributes.add("onclick","return foo()");
    }
    自己在前端,写一个javascript的foo函数,里面写 return confirm(xxxx);
      

  3.   

         if (confirm(meg)) {
                alert("ok");
            } else {
                this.close();
            }
      

  4.   

    Response.Write("<script>javascript代码</script>");
      

  5.   

    语句如下,想在if 那里加入类似confirm()语句该如何加阿。provide void menu1_menuitemclick(object sender, menueventargs e)switch (e.item.value)
    {
    case "0"
     If 对话框点确定
      {
    语句一
    }
    else
    {
    break;
    }}
      

  6.   

    C# code?if(!this.Page.IsPostBack) {   this.button1.Attributes.add("onclick","return foo()"); } 自己在前端,写一个javascript的foo函数,里面写 return confirm(xxxx);
    +1
      

  7.   

    cs:
    mycontrol.Attributes.Add("onclick", "confirm();");
    js:
    <input tyle="hidden" Id="hidValue"
    function confirm()}{
    var result = window.confirm("确定删除吗");
            if(result){
                window.location = "default.aspx?action=yes";//参数的方法
                hidValue="yes";//隐藏控件的方法
            }else{
                window.location = "default.aspx?action=no";
                 hidValue="no";
            }
    }
      

  8.   

    response.write("<script>alert('文字');中间这里放javascript程序;</script>");
      

  9.   

    看到大多实例都是设置button的onclick属性。但我现在使用menu菜单,该如何设置menu中选择的菜单,使之触发confirm()?谢谢