Error loading Partial View (file: ~/Views/MacroPartials/Reservation.cshtml). Exception: System.InvalidOperationException: The model item passed into the dictionary is of type 'Umbraco.Web.Models.PartialViewMacroModel', but this dictionary requires a model item of type 'Umbraco.Web.Models.RenderModel'.
Thanks for helping
EDIT:
I don't have any problems calling this from a non MacroPartialView:
Using @Html.EditorFor(x=>Model) in PartialView
I am trying to Render a form for a model in a partial view. But I can't get it working. Here is my code of the TestForm.cshtml:
What is the trick to get this working?
Error message from VisualStudio 2013:
Thanks!
EDIT: in this tutorial https://our.umbraco.org/documentation/Reference/Mvc/forms/turorial-partial-views shouldn't the CommentViewModel inherit something?
Hi TempleClause,
What I can see from the documentation that you are posting https://our.umbraco.org/documentation/Reference/Mvc/forms/turorial-partial-views, then it just have this
And not both.
Try also to see this post from Stackoverflow. http://stackoverflow.com/questions/21060767/the-inherits-keyword-is-not-allowed-when-a-model-keyword-is-used or if you should have both, then I think from this post http://stackoverflow.com/questions/8127462/the-view-must-derive-from-webviewpage-or-webviewpagetmodel/8127539#8127539 it should be
Hope this helps,
/Dennis
Thanks for the answer, I now noticed that my problem is of a different nature. I try to call
from a MacroPartial, but that doesn't seem to work. Is this not possible?
Oh and this is not very helpful:
Is there a way to print out more accurate error messages?
Hi TempleClause
You should be able to see more details about the error by going to the /App_Data/Logs file.
Hope this helps.
/Jan
Is it not possible to render a PartialView from a MacroPartialView? I'm still getting an error....
In my Reservation.cshtml I have:
And in my TestForm.cshtml I have:
and I get this error in the log:
Error loading Partial View (file: ~/Views/MacroPartials/Reservation.cshtml). Exception: System.InvalidOperationException: The model item passed into the dictionary is of type 'Umbraco.Web.Models.PartialViewMacroModel', but this dictionary requires a model item of type 'Umbraco.Web.Models.RenderModel'.
Thanks for helping
EDIT:
I don't have any problems calling this from a non MacroPartialView:
Got it working, see solution here: https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/53209-Render-PartialView-%28UmbracoTemplatePage%29-from-Macro-%28PartialViewMacroPage%29
Should use google first ... sorry guys
is working on a reply...