renderpartial with null model gets passed the wrong type
I have a page: <%@ Page Inherits=”System.Web.Mvc.View<DTOSearchResults>” %> And on it, the following: <% Html.RenderPartial(“TaskList”, Model.Tasks); %> Here is the DTO object: public class DTOSearchResults { public string SearchTerm { get; set; } public IEnumerable<Task> Tasks { get; set; } and here is the partial: <%@ Control Language=”C#” Inherits=”System.Web.Mvc.ViewUserControl<IEnumerable<Task>>” %> When Model.Tasks is not null, … Read more