【发布时间】:2013-05-04 21:55:54
【问题描述】:
@model Customer
@Html.Partial("_UserProfile", (UserProfile)Model.UserProfile)
当我运行这段代码时,我得到了这个错误:
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的区别很有用stackoverflow.com/questions/16886585/…
标签: c# asp.net-mvc razor partial-views helper