So I have this in my view (pseudo code):
for(int i=0;i<10; i++)
{
@Html.CheckBox("Article[" + i + "].ArticleID")
@Html.Textbox("Article[" + i + "].Quantity")
}
This is sent to a controller like this:
public ActionResult Save(IEnumerable<Article> Article)
{
}
Now the question is, how do I know (in my controller) which articles were checked? Because it returns all the form fields, not just the ones that are checked.
Nevermind, the code above does work as planned. The checkboxes that are not checked return 0, so I can filter those out.