There is no ViewData item of type 'IEnumerable' that has the key country

后端 未结 11 2172
鱼传尺愫
鱼传尺愫 2020-12-03 07:52

While binding dropdown in MVC, I always get this error: There is no ViewData item of type \'IEnumerable\' that has the key country.

<
11条回答
  •  情深已故
    2020-12-03 08:32

    I had a the same problem and I found the solution that I should put the code to retrieve the drop down list from database in the Edit Method. It worked for me. Solution for the similar problem

提交回复
热议问题