title: Error when using partial view in nopcommerce
body: <p>I am using nopcommerce 2.2 &amp; trying to use the partial view <code>ProductVariant_SKU_Man_Stock</code> in the <code>_Productbox.cshtml</code> but it comes up with the error:
  The model item passed into the dictionary is of type </p>
  
  <blockquote>
    <p>'System.Collections.Generic.List`1[Nop.Web.Models.Catalog.ProductModel+ProductVariantModel]',
    but this dictionary requires a model item of type
    'Nop.Web.Models.Catalog.ProductModel+ProductVariantModel'.</p>
  </blockquote>
  
  <p>Below is the <code>_Productbox.cshtml</code>:</p>
  
  <pre><code>@model Nop.Web.Models.Catalog.ProductModel
  &lt;div class="product-item"&gt;
  &lt;h2 class="product-title"&gt;
  @Model.Name
  &lt;/h2&gt;
  &lt;div class="description"&gt;
        @Html.Partial("_ProductVariant_SKU_Man_Stock",Model.ProductVariantModels)
      @Html.Raw(Model.FullDescription) &lt;br /&gt;
      @Model.Size
  &lt;/div&gt;
  &lt;div class="add-info"&gt;
      &lt;div class="prices"&gt;
          @Html.Partial("_ProductPrice", Model.ProductPrice)
      &lt;/div&gt;
      &lt;div class="buttons"&gt;
         @* &lt;input type="button" value="@T("Products.Details")" class="productlistproductdetailbutton" onclick="setLocation('@Url.RouteUrl("Product", new { productId = Model.Id, SeName = Model.SeName })')" /&gt;
  *@        @if (!Model.ProductPrice.DisableBuyButton)
          {
              &lt;br /&gt;
              &lt;input type="button" value="@T("ShoppingCart.AddToCart")" class="productlistaddtocartbutton" onclick="setLocation('@(@Url.RouteUrl("AddProductToCart", new { productId = Model.Id }))')" /&gt;
          }
       &lt;/div&gt;
       &lt;/div&gt;
       &lt;/div&gt;
  </code></pre>
  
  <p>Is there any other way of doing it coz i need some fields within that partial view to display in this view.</p>
  
  <p>productmodel.cs:</p>
  
  <pre><code> public class ProductModel : BaseNopEntityModel
  {
      public ProductModel()
      {
          ProductPrice = new ProductPriceModel();
         // ProductSku = new ProductSkuModel();
          DefaultPictureModel = new PictureModel();
          PictureModels = new List&lt;PictureModel&gt;();
          ProductVariantModels = new List&lt;ProductVariantModel&gt;();
          SpecificationAttributeModels = new List&lt;ProductSpecificationModel&gt;();
      }
  
      public string Name { get; set; }
  
      public string ShortDescription { get; set; }
  
      public string FullDescription { get; set; }
  
      public string ProductTemplateViewPath { get; set; }
  
      public string MetaKeywords { get; set; }
  
      public string MetaDescription { get; set; }
  
      public string MetaTitle { get; set; }
  
      public string SeName { get; set; }
      public string Size { get; set; }
      public ProductPriceModel ProductPrice { get; set; }
      public bool DefaultPictureZoomEnabled { get; set; }
      public PictureModel DefaultPictureModel { get; set; }
      public IList&lt;PictureModel&gt; PictureModels { get; set; }
      public IList&lt;ProductVariantModel&gt; ProductVariantModels { get; set; }
      public IList&lt;ProductSpecificationModel&gt; SpecificationAttributeModels { get; set; }
      public class ProductVariantModel : BaseNopEntityModel
      {
          public ProductVariantModel()
          {
              ProductSku = new ProductSkuModel();
              GiftCard = new GiftCardModel();
              ProductVariantPrice = new ProductVariantPriceModel();
              PictureModel = new PictureModel();
              AddToCart = new AddToCartModel();
              ProductVariantAttributes = new List&lt;ProductVariantAttributeModel&gt;();
          }
  
          public string Name { get; set; }
  
          public bool ShowSku { get; set; }
  
          public string Sku { get; set; }
  
          public string Description { get; set; }
  
          public bool ShowManufacturerPartNumber { get; set; }
  
          public string ManufacturerPartNumber { get; set; }
  
          public string DownloadSampleUrl { get; set; }
  
          public GiftCardModel GiftCard { get; set; }
  
          public string StockAvailablity { get; set; }
  
          public ProductVariantPriceModel ProductVariantPrice { get; set; }
  
          public AddToCartModel AddToCart { get; set; }
  
          public PictureModel PictureModel { get; set; }
          public ProductSkuModel ProductSku { get; set; }
  
          public IList&lt;ProductVariantAttributeModel&gt; ProductVariantAttributes { get; set; }
          public class ProductVariantPriceModel : BaseNopModel
          {
              public string OldPrice { get; set; }
  
              public string Price { get; set; }
              public string PriceWithDiscount { get; set; }
  
              public decimal PriceValue { get; set; }
              public decimal PriceWithDiscountValue { get; set; }
  
              public bool CustomerEntersPrice { get; set; }
  
              public bool CallForPrice { get; set; }
  
              public int ProductVariantId { get; set; }
  
              public bool HidePrices { get; set; }
  
              public bool DynamicPriceUpdate { get; set; }
          }
          public class ProductSkuModel : BaseNopModel
          {
  
  
              public string Sku { get; set; }
  
              public bool ShowSku { get; set; }
          }
  </code></pre>
  
  <p>Want to use this partial view :</p>
  
  <pre><code>@model Nop.Web.Models.Catalog.ProductModel.ProductVariantModel
  @if (!String.IsNullOrWhiteSpace(Model.StockAvailablity))
  {
      &lt;div class="stock"&gt;
  
          @Model.StockAvailablity
      &lt;/div&gt;
   }
  &lt;div class="clear"&gt;
  &lt;/div&gt;
  @if (!String.IsNullOrWhiteSpace(Model.Sku) &amp;&amp; Model.ShowSku)
  {
      &lt;div class="sku"&gt;
  
          @Model.Sku
      &lt;/div&gt;
  }
  &lt;div class="clear"&gt;
  &lt;/div&gt;
  @if (!String.IsNullOrWhiteSpace(Model.ManufacturerPartNumber) &amp;&amp; Model.ShowManufacturerPartNumber)
  {
      &lt;div class="manufacturerpartnumber"&gt;
  
          @Model.ManufacturerPartNumber
      &lt;/div&gt;
  }
  </code></pre>