@model Customer
@Html.Partial("_UserProfile", (UserProfile)Model.UserProfile)
Khi tôi chạy mã này, tôi nhận được lỗi này:(PartialView) Mô hình mục đã qua vào từ điển là loại 'khách hàng', nhưng từ điển này đòi hỏi phải có một mục mô hình của loại 'UserProfile'
The model item passed into the dictionary is of type 'Customer', but this dictionary requires a model item of type 'UserProfile'.
Xem một phần _UserProfile được nhập mạnh mẽ.
Tôi muốn có thể chỉnh sửa trường này. Bất kỳ đề xuất nào?
cũng kiểm tra sự khác biệt giữa Html.Action và Html.Partial là hữu ích https://stackoverflow.com/questions/16886585/html-partial-skips-the-controller-action –