ASP.Net MVC - model with collection not populating on postback

后端 未结 6 476
面向向阳花
面向向阳花 2020-12-01 19:08

I have an ASP.Net MVC application with a model which is several layers deep containing a collection.

I believe that the view to create the objects is all set up co

6条回答
  •  攒了一身酷
    2020-12-01 19:33

    Maybe lack of Bind attribute is the case:

    [AcceptVerbs(HttpVerbs.Post)]
    public ActionResult Create ([Bind] Person person)
    {
    // Do stuff to validate and add to the database 
    }
    

提交回复
热议问题