ihave a display view for displaying a list of rows
when the user checks/ selects the records i need the ids to be passed to another action method to get the recods from table and print it
displayview
@foreach(var item in Model)
{
@Html.HiddenFor(m => item.OrderId)
<tr>
<td>@Html.CheckBoxFor(m => item.IsChecked)</td>
<td>@item.OderedOn.ToLongDateString()</td>
<td>@item.Product</td>
</tr>
}
on submit button click i need to get the id in
public ActionResult Test(OrdersSelection[] orders)
model
public class OrdersSelection
{
public bool Checked { get; set; }
public bool ID { get; set; }
}
action method
[HttpPost]
public ActionResult Test(OrdersSelection[] orders)
{
var selectedOrders = orders.Where(o => o.Checked);
return View();
}
getting null