i code mis à jour et c'est la solution corect problèmepublierons tout vérifié chekbox
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(int[] rb, int id)
{
List<nastava_prisustvo> nastava = new List<nastava_prisustvo>();
string poruka = "";
for (int i = 1; i <=rb.Length; i++)
{
string name = "chk" + i;
string selID = Request.Form[name];
if (selID == "on")
{
//poruka = poruka + "Polje sa rednim brojem "+ i +" je chekirano\n";
nastava.Add(new nastava_prisustvo
{
br_indexa = int.Parse(Request.Form["id_stud"+i]),
id_predmet = id
});
}
}
// ViewData["Message"] = poruka;
return View("show", nastava);
}
Vue:
<table class="data-table">
<tr>
<th>
Redni br.
</th>
<th>
Br. Indexa
</th>
<th>
Prezime
</th>
<th>
Ime
</th>
<th>
<input id="check_all" type="checkbox" onclick="function" />
</th>
</tr>
<% int rb = 1;%>
<% foreach (var item in Model)
{ %>
<tr>
<td>
<input readonly="readonly" class="input-box" id="rb" type="text" name="rb" value="<%= Html.Encode(rb)%>" />
</td>
<td>
<input readonly="readonly" class="input-box" id="id_stud" type="text" name="id_stud" value="<%= Html.Encode(item.id_stud)%>" />
</td>
<td>
<%= Html.Encode(item.prezime)%>
</td>
<td>
<%= Html.Encode(item.ime)%>
</td>
<td>
<input id="check" name="chk<%= Html.Encode(rb)%>" type="checkbox" />
</td>
</tr>
<% rb = rb + 1;%>
<% } %>
</table>
Ci-dessus est la bonne solution – Ognjen