Home The ViewData item that has the key 'Catagory_id' is of type 'System.Int32' but must be of type 'IEnumerable<SelectListItem>'

# The ViewData item that has the key 'Catagory_id' is of type 'System.Int32' but must be of type 'IEnumerable<SelectListItem>'

user7564
1#
user7564 Published in September 21, 2018, 8:03 am

• The ViewData item that has the key 'XXX' is of type 'System.Int32' but must be of type 'IEnumerable<SelectListItem>' 1 answer

this is the table that have a relation with Category_id as you can see

and im using entity framework so you can see the class

this is my edit (get)controller

when i run my application it gives me this error on dropdownlist

i want to retrieve category_name data from the catalog_categories to show which product belongs to which category. need help