Reputation: 157
I have an issue about complex model binding in ASP.NET. I have currently that model
I send to my view a List <P>
public class P
{
public string Name {get;set;}
public Guid Uid {get;set;}
public List<ChildItem> Items {get;set;}
}
And i need to only modify one field in my ChildItem
but display many fields (the P.Name
and some of the fields from each ChildItem
) and submit the whole model (the List <P>
with edited values)
How can i achieve this kind of binding with the Html Helpers provided by ASP.NET
Upvotes: 1
Views: 1363
Reputation: 810
The optimum solution is to use editor templates and display templates. Here is a good tutorial. How to use EditorTemplates.
Upvotes: 1