Abhilash J A

Abhilash J A

  • 533
  • 2.4k
  • 598k

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

Jun 1 2016 5:28 AM
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)