1
我有一个表单,其中一个字段应该是另一个表中使用combox/multiple-select下拉列表的对象集合(0或更多),建立此操作的最佳实践是什么? e.g:组合框对象列表
public class Person{
public int PersonId { get; set; }
public string PersonName { get; set; }
public virtual ICollection<Address> Addresses { get; set; }
///or
public IList<Address> Addresses { get; set; }
///or
public IEnumerable<Addresses > Addresses { get; set; }
}
感谢
这样做是填充在控制器中您的地址列表,并使用Html.DropDownList帮手下来创建下降
感谢您的答复。问题不在于下拉,我能够确定这一点。即时通讯试图在数据库中存储“列表”,是否可以在C#MVC3? –
我根据对问题的误解编辑了“答案”。希望这可以帮助。 – kingrazor