c# - (PartialView) The model item passed into the dictionary is of type 'Customer', but this dictionary requires a model item of type 'UserProfile' -
@model customer @html.partial("_userprofile", (userprofile)model.userprofile)
when run code, error:
the model item passed dictionary of type 'customer', dictionary requires model item of type 'userprofile'.
partial view _userprofile typed.
i want able edit these field. suggestions?
make sure model.userprofile not null.
i found post trying debug same error, , turned out hadn't initialised "model.userprofile" equivalent.
i guess what's happening here, if null model passed renderpartial, defaults using main view's model? can confirm this?
Comments
Post a Comment