6
Element ViewData, który ma klucz „XXX”, jest typu „System.Int32”, ale musi być typu „IEnumerable <SelectListItem>”
Mam następujący model widoku public class ProjectVM { .... [Display(Name = "Category")] [Required(ErrorMessage = "Please select a category")] public int CategoryID { get; set; } public IEnumerable<SelectListItem> CategoryList { get; set; } .... } i następującą metodę kontrolera, aby utworzyć nowy projekt i przypisać plik Category public ActionResult Create() { …
114
c#
asp.net-mvc