everyone! I'm learning ASP.NET MVC and have some question. My problem is Passing Data from View to Controller.
This my Code:
@{
string listID = "";
}
and I try to use this variable:
function SubmitDelete() {
var listId = "";
var x = document.getElementsByName("IsCheck");
for (var i = 0; i < x.length; i++) {
if (x[i].checked == true) {
listId += x[i].value + ", ";
};
}
@listID = listId;
return listId;
}
Finalize, I want to pass @listID to Controller:
@using (Html.BeginForm("DeleteChecked", "Category", new { listID }, FormMethod.Post)){ }
It is simple problem about multi delete with checkbox. Help me, please.