jquery msgbox在确认之前删除gridview行?

时间:2013-07-11 21:20:54

标签: javascript jquery updatepanel updateprogress msgbox

我想在确认后删除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代码;
    

0 个答案:

没有答案