I have a class
public class Citizen
{
public long ID { get; set; }
public string Name { get; set; }
public long CityID { get; set; }
public stri
The expression you sent causes that name:
What I get is name="Resources[0].CurrentAmount" which then doesn't map correctly to the CitizenResource class.
@Html.EditorFor(model => model.Resources[i].CurrentAmount, new { htmlAttributes = new { @class = "form-control" } })
Instead have a partial view to edit an CitizenResource
@model CitizenResource
@using(Html.BeginForm("EditResource", "Citizen")){
{
//The complete elements
@Html.EditorFor(model => model.CurrentAmount, new { htmlAttributes = new { @class = "form-control" } })
//The rest of the elements
}}