I have a mistake that I understand, but I canβt figure out how to solve it correctly.
I have a MasterPage, from this MasterPage I call:
<% Html.RenderPartial("Tags"); %>
Tags are a strongly typed representation that looks like this:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<JegManglerEn.Controllers.CategoryCount>>" %>
I am returning a PartialView as follows:
return View("Tags", result);
where the result is correct and type:
List<CategoryCount>
Error:
The model element passed to the dictionary has the type "System.Collections.Generic.List 1[JegManglerEn.Item]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable1 [JegManglerEn.Controllers.CategoryCount]".
So the setup is this:
MasterPage loads the view, which takes the JegManglerEn.Item collection, and also tries to load the PartialView, which takes the JegManglerEn.Controllers.CategoryCount collection ... but does not.
, - RenderPartial, , RenderAction, .
, MVC soruce startup Reflector.
!