DefaultModelBinder not binding nested model

前端 未结 5 1463
梦谈多话
梦谈多话 2020-12-31 09:57

Looks like others have had this problem but I can\'t seem to find a solution.

I have 2 Models: Person & BillingInfo:

public class Person
{
 publi         


        
5条回答
  •  Happy的楠姐
    2020-12-31 10:34

    I had the same issue, the previous developer on the project had the property registered with a private setter as he wasn't using this viewmodel in a postback. Something like this:

    public MyViewModel NestedModel { get; private set; }
    

    changed to this:

    public MyViewModel NestedModel { get; set; }
    

提交回复
热议问题