I'm working on a project where I have a page that lists some records, of which I'll 'thumb' some to perform batch actions, such as exclusion, status change, etc.
How do I send this list of my records to different actions?
My list is built like this:
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<table>
<tr>
<th>Selecione</th>
<th>Descrição</th>
</tr>
@for (int r = 0; r < Model.Count(); r++)
{
<tr>
<td>@Html.CheckBoxFor(i => i[r].Selecionado)</td>
<td>@Html.DisplayFor(i => i[r].Descricao)</td>
</tr>
}
</table>
<input type="button" value="Alterar Selecionados Para Status x" />
<input type="button" value="Alterar Selecionados Para Status y" />
<input type="button" value="Alterar Selecionados Para Status z" />
}
In my post method, I get the parameter as follows:
[...]
public ActionResult SelectLines(List<Objeto> list) { [...] }