2013-05-30 28 views
1

我目前在VS 2012中使用MVC4與MySql構建網站。我有問題,當我試圖顯示我的數據和得到這個錯誤:MVC4與MySql

The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[System.String]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[MyMvc4SalesStatistics.Models.users_internal_group_membership]'. 

截圖:Image

+1

難道你不明白什麼部分消息的? – SLaks

+3

嘿,請向我們展示您返回View()的Controller代碼。看起來你正在傳遞錯誤的模型類型。 – KingCronus

回答

0

它,因爲在你看來類型是System.Web.Mvc.View<IEnumerable<User-Internal-Group-MemberShip>>但你在你的控制器返回一些其他數據

return View(UserInternalGroupMemberShip.); //必須返回您的模型對象以供查看,

但是我不確定。

請參閱本discussion

,看看this

+0

感謝RameshRams它是整理:) –