@model Customer
@Html.Partial("_UserProfile", (UserProfile)Model.UserProfile)
当我运行这段代码,我得到这个错误:(PartialView)模型传递到字典中产品类型的“客户”,但本词典需要类型的模型项目“用户配置”
The model item passed into the dictionary is of type 'Customer', but this dictionary requires a model item of type 'UserProfile'.
部分视图_UserProfile是强类型的。
我希望能够编辑这些字段。 有什么建议吗?
还检查Html.Action和Html.Partial之间的区别是有用的https://stackoverflow.com/questions/16886585/html-partial-skips-the-controller-action – 2017-12-06 15:47:42