This is editted !
(I tryed the provided answer as well with the ViewData approach and this hasn't solved my answer) since i can not post more than 2 links and i didn't kept all tryed suggestions this is the reason why this post does not contain all tryed methods in code.
Hello and thank you for reading this ,
I have spend over 4 hours with my teacher with this and we tryed all suggestions google gave us (over 10 different solutions) but none of them fixed it...
So what i want is to populate a dropdown with a list of objects (HotelChains). The error im getting is:
The ViewData item that has the key 'SelectedHotelChain' is of type 'System.Int32' but must be of type 'IEnumerable<SelectListItem>'.
(cant post more than 2 links) My layout is like this :
Html.DropDownListFor(model => model.SelectedHotelChain, Model.HotelChains, "(boo)")
also tryed
@Html.DropDownList("HotelChains", Model.HotelChains, "(none)")
and with viewData also like this (with off course the appropiate notations in the model)
@Html.DropDownList("Options", ViewData["Options"] as SelectList, "--Select Item--")
We really tryed a lot of things also with ViewData[] and many others , this is for my dissertation (in 2 weeks) so i hope wome one can help me as i gonna have to switch to ASP if it doesn't get answered.
Kind Regards !