Dynamically Created Textboxes Not Bound To Model

后端 未结 1 1634
故里飘歌
故里飘歌 2020-12-12 07:38

My viewmodel contains a list of strings:

public class SupplierViewModel
{
    public Supplier Supplier { get; set; }
    public List Numbers;
}         


        
1条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-12 07:42

    Numbers is a field and the DefaultModelBinder cannot set the value of a field. You need to make it a property by adding getters/setters

    public List Numbers { get; set; }
    

    0 讨论(0)
提交回复
热议问题