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)
{
}
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn