The ViewData item that has the key 'MY KEY' is of type 'System.String' but must be of type 'IEnumerable'

后端 未结 9 1771
日久生厌
日久生厌 2020-11-28 03:02

I am trying to populate a dropdown list from a database mapped with Linq-2-SQL, using ASP.NET MVC 2, and keep getting this error.

I am so confused because I am decla

9条回答
  •  猫巷女王i
    2020-11-28 03:55

    I've just come across this issue and this article helped me through it - http://odetocode.com/Blogs/scott/archive/2010/01/18/drop-down-lists-and-asp-net-mvc.aspx

    The most likely cause it that your collection is repopulated after the po

提交回复
热议问题