0

我想在确认后删除 rocord 但是当我单击按钮时会立即删除记录并在显示确认后删除。这是脚本;

function confirm() {
          var count = document.getElementById("<%=hfCount.ClientID %>").value;
          var gv = document.getElementById("<%=GridView1.ClientID%>");

          var chk = gv.getElementsByTagName("input");
          for (var i = 0; i < chk.length; i++) {
              if (chk[i].checked) {
                  count++;
              }
          }
          if (count == 0) {

              $.msgBox(
              {
                  title: "Alert",
                  content: "Please select record!",
                  type: "info"
              })

          }
          if (count > 0) {

              $.msgBox(
              {
                  title: "Alert",
                  content: "Do you want to delete selected("+count+")records? ",
                  type: "confirm",
                  buttons: [{ value: "yes" }, { value: "no"}],
                  success: function (result) {
                      if (result == "yes") {
                          alert ("delete success");

                          });



                      }
                  }
              })

这里是asp.net代码;

4

0 回答 0