The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[BMS.DataAccess.Models.ServiceTyp

之前调试还好好的,后来数据表加了几个字段就报这个错误,不过后来终于解决了,原因是增加的某个字段值为null,导致MVC的View识别不了,源代码<%=m.Description.Replace("$", "<br/>")%> 

改成如下就可以了

<%=(string.IsNullOrEmpty(m.Description)) ? string.Empty : m.Description.Replace("$", "<br/>") %>

 

 

 

 

posted on 2010-01-14 10:11  Kingly  阅读(2393)  评论(1编辑  收藏  举报