I have a problem with my view checkboxes, and I can not understand how I can take all the values that are selected and send them to the controller to be able to operate with them.
I have the following: Vista.
@model List<Model.ofertas_contactos>
@{
ViewBag.Title = "Listado general de solicitudes";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<head>
<meta http-equiv="refresh" content="20">
</head>
@* Empieza la vista *@
<body style=" background-color:#353435">
<h1 style="color:#fff; padding-top:30px" align="center">Listado General de Solicitudes Pendientes</h1>
<br />
<table align="center" class="table-striped, text-center, table-condensed" style="font-size:20px" cellpadding="20">
@* Cabecera *@
<thead>
<tr class="text-center" style="color:#e98300;font-family:'Trebuchet MS'">
<th class="text-center" ; bgcolor="black"><input type="checkbox" name="chkAll" value="All" id="selecctall" /></th>
<td class="text-center" ; bgcolor="black">Hora solicitud</td>
<td class="text-center" ; bgcolor=" black">Capturar</td>
</tr>
</thead>
<tbody>
foreach (Filtro)
{
<tr style="color:white ;font-family:'Trebuchet MS'">
<td class="text-center"><input type="checkbox" name="sid" value="@usu.idContacto" class="checkbox1" /></td>
<td>@usu.fechaHora</td>
<td class="text-center"><a class=" btn btn-primary btn-lg" href="~/home/capturar/@usu.idContacto" title="Capturar"></a></td>
</tr>
}
</tbody>
</table>
@*Boton*@
<a class="btn btn-primary" href="ruta/cambiarCampo" title="Cambiar Campo" style="margin-left:473px; margin-top:30px">Cambiar Campo</a>
</body>
And in the HomeController I have the following:
public ActionResult cambiarCampo(int[] id)
{
return View();
}