return confrim("你确定要删除吗?")

解决方案 »

  1.   

    private void Button4_Click(object sender, System.EventArgs e)
    {
      Button4.Attributes.Add("onclick","return confirm('确实要删除当前行记录吗?');");
    }
      

  2.   


    if(MessageBox.Show("yesno","警告窗",MessageBoxButtons.OKCancel,MessageBoxIcon.Question)==DialogResult.OK) 
    {
    MessageBox.Show("it is ok");//do something
    } :)
      

  3.   

    楼主问的是web窗体吗?那楼上说的没错。return confirm返回bool值,为true时继续执行服务器端代码,否则返回。
    如果是winform,就要用MessageBox.Show()方法了
      

  4.   

    DialogResult result=MessageBox("确认要删除吗?","系统提示",MessageBoxButton.Okno);
    if(result==DialogResult.OK)
       ...............
      

  5.   

    if(DialogResult.Ok==MessageBox.Show("("你确定要删除吗?","确认",MessageBoxButtons.OKCancel))
    {
         ...........此处添加你的代码
    }
    else
    {
        ...........此处添加你的代码}
    详细信息请参考MSDN:
    ms-help://MS.VSCC/MS.MSDNVS.2052/cpref/html/frlrfsystemwindowsformsmessageboxclassshowtopic.htm