I have a model that include a list of another model.Now,I try use it in partial view page as a dropdownlistfor.I don't want use viewbag or selectlist.Do I need to write a helper ?
Product Model
[Key]
public int Id { get; set; }
public int? Code { get; set; }
public int? ProductGroupId { get; set; }
public virtual ProductGroup ProductGroup { get; set; }
public List<ProductGroup> ProductGroups { get; set; }
ProductGroup Model
[Key]
public int Id { get; set; }
public int? THoldingAdminsId { get; set; }
public virtual List<Product> Products { get; set; }
public int? Code { get; set; }
public string CName { get; set; }
I want display a list of productgroup in product form as a dropdownlistfor. any help ?