If Jquerypost transmits Arrays for batch deletion, an array of data IDs to be deleted is required. The following is the specific implementation code, if you are interested, you can refer to the following example to delete data in batches. To delete data in batches, you will need to pass the data ID array to be deleted.
The Code is as follows:
Function RemoveLog (){
Var postModel = [];
// Retrieve the ID of the data to be deleted and store it in the array.
$ ("[Name = 'lid']"). each (function (){
If ($ (this). attr ("checked") = "checked ")
PostModel. push ({name: 'kids', value: $ (this). val ()});
});
If (postModel. length = 0 ){
Alert ('select the content to delete first! ');
Return;
}
// Post Deletion method, passing an array
$. Post ('/admin/delete', postModel, function (data ){
});
}
The Code is as follows:
// C # Use the corresponding List collection class in the background to receive data.
Public JsonResult Delete (List Ids)
{
}