Using jQuery to get multiple checkbox's value and Multiple Delete Using jquery json

I have already bind a html table using jQuery json. I want to get multiple checkbox value using jQuery json and delete by selected multiple delete method. This is my code for bind the table.
$(function () {
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebForm5.aspx/BindDatatable",
data: "{}",
dataType: "json",
success: function (dt) {
for (var i = 0; i < dt.d.length; i++) {
$("#example1 > tbody").append("

" + dt.d[i].CategoryID + "" + dt.d[i].Name + "" + dt.d[i].Status + " SubmitDelete ");

         error: function (result) {


This is my Button to Delete selected(multiple delete):

Delete Selected

This is my html table:

<div class="box-body">
            <button type="button" name="deletebtn" id="deletebtn">Delete Selected</button>
          <table id="example1" class="table table-bordered table-striped">

                <th>Check Box</th>
                <th>Category Name</th>
                <th>Category Details</th>

              <tbody id="myBody">




You just tell me :

1.what is the code to select all the checkbox??

2.Code to delete using multiple jquery??

The Server side Code is here For Single Delete(with out checkbox):

public static void deleteRecord(int Id)

    clsCategoryBL objproject = new clsCategoryBL();



In BL:

public string CategoryDelete(int CategoryID)
using (KSoftEntities db = new KSoftEntities())

            var categoryDetails = db.tblCategories.Where(i => i.CategoryID == CategoryID).SingleOrDefault();

            return "Record deleted successfully";
        catch (Exception ex)

        return "Error on deletion";

The Delete is Occur on the Client Side by Using This code:

$().ready(function () {

     $('body').on('click', '#deletebtn', function () {
         $("#example1 tr").each(function () {
             var rowSelector = $(this);
             if (rowSelector.find("input[type='checkbox']").prop('checked')) {


I want To delete it on server Side that means also on my database(Sql) So what should i do???

I Want To Delete Multiple Row By Click On Multiple CheckBox On Database Also..I have mention in above the backend code also..I want to delete the row of html table by click 2 to 3 checkbox(it may be vary depend upon the data) and click Delete Selected button..

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!