When I try to render a partial view whose model type is specified as:
@model dynamic
by using the following code:
@{Html.RenderPartial("PartialView", Model.UserProfile);}
I get the following exception:
'System.Web.Mvc.HtmlHelper<dynamic>' has no applicable method named 'RenderPartial' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.
However, the same code in a .aspx file works flawlessly. Any thoughts?