2
Answers

how to get all checked checkbox value in controller in mvc 4

Mani Kandan

Mani Kandan

8y
384
1
Sir,<br /><div></div><div>please check the below details,</div><div>&nbsp;</div><span style="color: red;">View</span>:- Inside jQuery datatable there is a checkbox in the loop:<br /> @foreach (var item in Model)<br /> {<br /> &lt;input type="checkbox" id="@item.Id" name="[email protected]" class="chkProductDetails" /&gt; }<br /><br /><span style="color: red;">Controller</span>:- But, using by below code, I can not get all checked checkbox id's from jQuery datatable under the "Cb_"<br /><br />FormCollection frm = new FormCollection();<br /> <br />foreach (var item in frm.AllKeys)<br /> {<br /> if (item.Contains("cb_"))<br /> {<br /> var ids = item.Split(new[] { "cb_" }, StringSplitOptions.RemoveEmptyEntries); <br />}<br /><br />Kindly replay me.
Answers (2)