Take batch deletion of data as an example. To do batch deletion, you need to pass the data ID array to be deleted
function RemoveLog(){
var postModel=[];
//Traverse the checkbox to get the data ID to be deleted and store it in the array
$("[name='lid ']").each(function () {
if ($(this).attr("checked") == "checked")
postModel.push({ name: 'ids', value:$ (this).val()});
});
if(postModel.length == 0) {
alert('Please select the content to be deleted first!');
return ;
}
//post delete method, pass array
$.post('/admin/Delete',postModel,function(data){
});
}
//C# uses the corresponding List collection in the background The class can receive data
public JsonResult Delete(List ids)
{
}