In my index page, i have multiple checkboxes that can be selected:
@foreach (var item in Model) {
<tr>
<td class ="text-nowrap">
<input class="chkSelect" type="checkbox" name="Selected" value="@item.Id">
</td>
<td>
@Html.ValueFor(modelItem => item.trandate, "{0:dd/MM/yyyy}")
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.Id })
</td>
</tr>
}
I need to get the selected items and pass them to another form/page /action where i want to use the ids of the selected item to perform other actions. How do i pass the selected items to the controller action of the other page ?
so , now i created public ActionResult SendSMS(string[] msisdn)
{
return View();
}
and
@using (Html.BeginForm("SendSMS", "Subscribers", FormMethod.Post))
{
<div class="form-group">
<a href="@Url.Action("SendSMS", "Subscriber", new { msisdn = Request["Selected"] })"> <span class="btn btn-primary"> <i class="fa fa-envelope"></i> Send SMS</span> </a>
</div>
}
So, will Request["Selected"] hold all the selected items? it appears null when debugging.
int[] Selected- user3559349