2017-06-18 27 views
0

在ASP.NET MVC核心项目,重叠传递数据时,观看部件和View

我在布局页查看组件和字符串类型的数据传递给它,

和我认为我运行错误时通过类型整数给它的数据,

问题出现:

InvalidOperationException: The model item passed into the ViewDataDictionary is of type 'System.Int', but this ViewDataDictionary instance requires a model item of type 'System.String'. 
+0

'返回查看(yourInteger.ToString()) ' – haim770

+0

您能否包含我们审查的源代码? – mjwills

回答

0

的问题,因为我是我的模型作为字符串传递给视图组件, 和视图把它作为视图名未模型 我把我的字符串类,并把它作为模型类,并将它与我的工作 感谢任何一个试图帮助我