title: how to use Html.RenderPartial with ViewModel
body: <p>i am trying to create user reviews under each product, i used <code>Html.RenderAction</code></p>
  
  <pre><code> Html.RenderAction("ProductReviewTest", new { id = productids });
  </code></pre>
  
  <p>it works fine but it takes 9.4s to load the product page with the reviews, so tried Html.RenderPartial but gives error</p>
  
  <p><strong>my product view:</strong></p>
  
  <pre><code>@model MVCProduct.Models.Product
  
  &lt;!--here displaying products--&gt;
  
  &lt;!--displaying reviews in same view--&gt;
  
  &lt;div class="display-field"&gt;
  &lt;p&gt; Reviews for @Html.DisplayFor(model =&gt; model.ProductTitle) &lt;/p&gt;
  @{ 
  
  int productid = Model.ProductID;
  
  Html.RenderPartial("ProductReviewTest", new { id = productid });
  
  }
  
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>my review view model:</strong></p>
  
  <pre><code>public class ProductViewModel
  {
      public int ReviewId { get; set; }
      public int? ProductID { get; set; }
      public string ReviewTitle { get; set; }
      public string ReviewMessage { get; set; }
      public int? Rating { get; set; }
      public string CustomerName { get; set; }
      public string ReviewStatus { get; set; }
  
  }
  </code></pre>
  
  <p><strong>my ViewResult:</strong></p>
  
  <pre><code> public PartialViewResult ProductReviewTest(int id)
      {
  
      List&lt;ProductViewModel&gt; productviewmodel = (from a in dbo.ProductReviews 
      where a.ProductID ==id
      select new ProductViewModel
          {
               ReviewId=a.ReviewId, 
               ProductID=a.ProductID,
               ReviewTitle =a.ReviewTitle,
               ReviewMessage =a.ReviewMessage,
               Rating =a.Rating,
               CustomerName =a.CustomerName,
               ReviewStatus=a.ReviewStatus
          }).ToList();
  
  
  
          return PartialView(productviewmodel);
      }
  </code></pre>
  
  <p><strong>my review view:</strong></p>
  
  <pre><code>   @model IEnumerable&lt;MVCProduct.Models.ProductViewModel&gt;
  
  &lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.ReviewId)
          &lt;/th&gt;
  .......
  
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>error:</strong></p>
  
  <blockquote>
    <p>The model item passed into the dictionary is of type
    '&lt;>f__AnonymousType5<code>1[System.Int32]', but this dictionary requires a 
    model item of type
    'System.Collections.Generic.IEnumerable</code>1[Review.Models.ProductViewModel]'.</p>
  </blockquote>
  
  <p>any help would be great.</p>