【发布时间】:2012-03-21 07:23:31
【问题描述】:
我有一个基于 Nominees 的 Viewmodel。我可以有多个视图模型的提名者。
我想从视图中填充 Ilist。这是我的视图模型
public class DebitViewModel:IValidatableObject
{
public string AgentName { get; set; }
public Debit Debit { get; set; }
public Policy Policy { get; set; }
public PolicyType PolicyType { get; set; }
public Customer Customer { get; set; }
public IList<PolicyType> PolicyTypes { get; set; }
public List<Nominee> Nominees { get; set; }
public Dictionary<int,string> OccupationTypes { get; set; }
}
我想在按下 submit 时自动填充所有 Nominess。那么我应该如何通过视图创建并使其自动填充列表?而不是单独的对象?
【问题讨论】:
标签: asp.net-mvc asp.net-mvc-3 viewmodel