Home > Articles > Details

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?

 

 


If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

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

© 2022 - ErnesTech - Privacy