在后台写删除操作,i值为要删除的记录条数,单击删除按钮时弹出对话框提示用户确实要删除这i条记录吗?点击确定,则提示删除成功。附程序:
 protected void btnDelete_Click(object sender, EventArgs e)
    {
        string contactID = "";
        ArrayList arrCount = new ArrayList();
        ArrayList arrContactID = new ArrayList();
        for (int i = 0; i < gridShowContact.Rows.Count; i++)
        {
            CheckBox chk = (CheckBox)(gridShowContact.Rows[i].Cells[0].FindControl("chkCheck"));
            if (chk.Checked == true)
            {
                arrCount.Add(i);
                contactID = Convert.ToString(((HiddenField)gridShowContact.Rows[i].Cells[0].FindControl("hdfID")).Value);
                arrContactID.Add(contactID);
            }
        }
        if (arrCount.Count == 0)
        {
            this.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script>alert('至少选择一条记录删除')</script>");
        }
        else
        {
          //在这里向前台传递数据(我认为),弹出对话框,确定则执行删除操作,并提示删除成功,取消则不执行
            for (int j = 0; j < arrContactID.Count; j++) //confirm框,确定则执行此句,取消则跳过
            {
                delete(arrContactID[j].ToString());
            }
            
        }
    }