AspNet MVC ViewData Error: InvalidOperationException: There is no ViewData item of type 'IEnumerable<SelectListItem>' that has key 'Type'


Question: How do you resolve the error: InvalidOperationException: There is no ViewData item of type 'IEnumerable<SelectListItem>' that has key 'Type' in MVC asp.net 6 View?

 

 






Jack said:

Check your ViewBag it is clear the ViewData is empty while the DropDown Html Tag tries to bind the values. Check for Null Exception first before binding your ListItems.

Posted On: December 05, 2021 13:46:16 PM

© 2023 - ErnesTech - Privacy