how is it possible to retrieve data from TextBoxFor helper within a foreach loop? I mean:
in the view:
foreach(Language l in ViewBag.Languages){
<td>@l.lang</td>
<td>@Html.TextBoxFor(model => model.Name)
}
and how can I retrieve it in the controller once posted?
MyModel.Name //this returns the value of the first textbox within the foreach loop
By the way model.Name is defined in MyModel.cs as:
public string Name { get; set; }