title: ASP.NET MVC IEnumerable Issues with RenderPartial
body: <p>I have a main page which uses a ViewModel I have created:</p>
  
  <pre><code>public class HomeViewModel
  {
      public List&lt;Category&gt; Categories { get; set; }
      public List&lt;Image&gt; Images { get; set; }
  
      public HomeViewModel(List&lt;Image&gt; images, List&lt;Category&gt; categories)
      {
          Images = images;
          Categories = categories;
      }
  }
  </code></pre>
  
  <p>On my main page I am outputing the Categories but then passing the Images through to a PartialView.</p>
  
  <pre><code>&lt;div id="gallery"&gt;
      &lt;% Html.RenderPartial("gallery", Model.Images); %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When I run my work I am getting this error: error CS0308: The non-generic type 'System.Collections.IEnumerable' cannot be used with type arguments</p>
  
  <p>This is my partial view:</p>
  
  <pre><code>&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;IEnumerable&lt;Gallery.Models.Image&gt;&gt;" %&gt;
      &lt;%@ Import Namespace="Gallery.Helpers" %&gt;
  
      &lt;ul&gt;
          &lt;% foreach (var item in Model)
          { %&gt;
              &lt;li&gt;             
                  &lt;%= Html.ImageLink(item.imageID.ToString(), Url.Content("~/Uploads/" + item.imageLocation).ToString(), item.imageDescription, Url.Content("~/Uploads/" + item.imageThumb).ToString(), item.imageDescription, null)%&gt;
              &lt;/li&gt;
          &lt;% } %&gt;
      &lt;/ul&gt;
  </code></pre>
  
  <p>I was using .NET 4 and this worked fine but I understand they have altered Generics since 3.5 which made it possible. However my web server company hasn't upgraded their servers meaning I have to deploy using 3.5.  I have got the Partial to work if I cast the Partial as the same object as the Main page but then I am passing through more ViewData than I need to. The reason I am using Partials is to take advantage of AJAX in the .NET framework. E.g. the Categories are AJAX links goto a method that method returns an updated Partial with the category images, I should only need to pass Images into the Parial.</p>
  
  <p>Any help on solving this would be appreciated.</p>
  
  <p>Thanks,</p>
  
  <p>Jon</p>