My controller action is here:
[HttpPost]
public ActionResult Index(List<Widget> widgets, int index)
{
widgets.RemoveAt(index);
return View(widgets);
}
My post to this action looks like this:
[0].Name a
[1].Name b
[2].Name c
index 1
When I debug, I see that there is only one item in my list. I can correct the issue by changing the parameter name from index to _index.
I couldn't find anything where index was a reserved word. Any thoughts as to why this happens?