简体   繁体   中英

Binding List of Lists with ASP.NET Razor

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

The optimum solution is to use editor templates and display templates. Here is a good tutorial. How to use EditorTemplates .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM