小弟想在ASP.NET做winform里的消息框效果,点一下按扭,提示YES 或 NO,点YES执行、点NO不执行,请大家指点谢谢!

解决方案 »

  1.   

    return window.confirm("Are u sure?");在javascript中写
      

  2.   

    function ent()
     {
      if(confirm("您确定执行吗?"))
        {
          return true;
     }
       return false;
      }
      

  3.   

    button.Attibutes["onclick"] = "return window.confirm('are you sure?')"
      

  4.   

    DialogResult dr = MessageBox.Show("hello word", "test", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1);
               if (dr == DialogResult.OK)
               {
                   MessageBox.Show("love");
               }
               else
               {
                   MessageBox.Show("fuck");
               }
      

  5.   

    if(confirm("您确定执行吗?"))
        {
          return true;
     }
       return false;
      

  6.   

    button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}")