Create Views for object properties in model in MVC 3 application?

后端 未结 2 395
一个人的身影
一个人的身影 2021-01-24 01:59

I have an Asp.Net MVC 3 application with a database \"Consultants\", accessed by EF. Now, the Consultant table in the db has a one-to-many relationship to several other tables f

2条回答
  •  情歌与酒
    2021-01-24 02:14

    Phil Haack has written a great blog post which explains how to model bind to a list. It's specific to MVC2, but I'm not sure if version 3 has improved on this.

    Model Binding To A List.

    In a scenario where the user is allowed to add an arbitrary number of items, you'll probably want to create new input fields using JavaScript. Steven Sanderson shows here how to achieve that:

    Editing a variable length list, ASP.NET MVC 2-style.

    Those resources should get you all the way there.

提交回复
热议问题