.net的web页面里想实现一个,能不能实现点击一个按钮,弹出一个消息框,左确定,右取消,确定就执行button的click事件,取消就关闭消息框,好像vb脚本能写,偶不太清楚,希望各位大侠帮忙!!!

解决方案 »

  1.   

    ibtndel.Attributes.Add("onclick", "javascript:if(!confirm('你确定要删除该xx吗?')) { return false; }")
      

  2.   

    button1.Attributes.Add("onclick", "javascript:{if(confirm('确定删除用户吗?')==false) return false;}")这这个加到page_load事件中。button1是你按狃的ID
      

  3.   

    hackate(兰花开香入梦境,独思佳人亦飘然!!) 正解
      

  4.   

    在page_load中,写入下代码(请将你的按钮发布到Runat="Server")
    this.Button1.Attributes.Add("onclick","var vconfirm = window.confirm('');if(vconfirm==false){window.Form1.document.getElementById('textbox_judge').value=false;}else{ window.Form1.document.getElementById('textbox_judge').value=true;}");
    在下面的函数中利用返回的True,和False来完成你自己的意图。
      

  5.   

    this.Response.Write("<script language='javascript'>");
    this.Response.Write("aa=window.confirm('您确定要删除帐号"+this.Request.Params["actid"].ToString()+"?');");
    this.Response.Write("if(aa==false){");
    this.Response.Write("window.location.href='usrlist.aspx'");
    this.Response.Write("}");
    this.Response.Write("if(aa==true)");
    this.Response.Write("{");
    this.Response.Write("window.location.href='del_usr.aspx'");
    this.Response.Write(" } ");  
    this.Response.Write("</script>");你可以跳到另一页处理
      

  6.   

    button1.Attributes.Add("onclick", "javascript:{if(confirm('确定删除用户吗?')==false) return false;}") 我试过可以啊