I want to post data to the server. In the form i've selected checked checkboxed and retrieve values from them. I used the following code:
$(".DownloadSelected").click(function () { var values = []; var chks = $(':checkbox[name="ids"]:checked'); $(chks).each(function (i) { values[i] = $(this).val(); }); $.post("/Documents/DownloadSelected/", { ids: values }); });
In controller i have this:
[HttpPost] public ActionResult DownloadSelected(int[] ids) { }
The problem is that in controller i retrieved null values in int[]ids array. Can anybody help me?