Confirmation message box in webapplication

后端 未结 8 1646
刺人心
刺人心 2020-12-19 19:16

Am using the below message box in asp.net web application. Now i want to convert this message box as a confirmation message box and do something when it is true else means r

相关标签:
8条回答
  • 2020-12-19 19:43

    The javascript equivalent to a confirmation box is the confirm() method. This method returns a true or false value depending on the user's "OK" or "Cancel" button response.

    Usage:

    var confirmed = confirm('Are you sure?','Are you sure you want to delete this item?');
    
    if(confirmed){
      //do something
    } else {
      //do something else
    }
    
    0 讨论(0)
  • 2020-12-19 19:45
    private void showMessage(string msg){
    
            ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "<script language='javascript'>alert('"+ msg +"');</script>", false);
    

    protected void BtnReg_Click(object sender, EventArgs e) {

            OracleHelper.OracleDBOpen();
            object flag = OracleHelper.OracleExecuteScalar("your select Query ");
            if (flag == null)
            {
                          showMessage("Failed !!! ");
    
            }
            else
            {
                string reg = String.Format("your Insert Query ");
    
                showMessage("successfuly");
                OracleHelper.OracleExecuteNonQuery(reg);
    
            }                
            OracleHelper.OracleDBClose();
        }
    }
    
    0 讨论(0)
提交回复
热议问题