title: Passing a model through a Partial View MVC3
body: <p>I have a Partial View that goes like this:</p>
  
  <pre><code>@model IEnumerable&lt;NutricionApp.Models.Ingrediente&gt;
  
  &lt;table&gt;
  &lt;tr&gt;
      &lt;th&gt;
          NombreIngrediente
      &lt;/th&gt;
      &lt;th&gt;
          CantidadPorPorcion
      &lt;/th&gt;
      &lt;th&gt;
          UnidadPorPorcion
      &lt;/th&gt;
      &lt;th&gt;&lt;/th&gt;
  &lt;/tr&gt;
  
  @foreach (var item in Model) {
  &lt;tr&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.NombreIngrediente)
      &lt;/td&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.CantidadPorPorcion)
      &lt;/td&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.UnidadPorPorcion)
      &lt;/td&gt;
  
  &lt;/tr&gt;
  }
  
  &lt;/table&gt;
  </code></pre>
  
  <p>I want to render said partial view in this View, that is strongly typed:</p>
  
  <pre><code>@model NutricionApp.Models.Platillo
  
  @{
      ViewBag.Title = "Create";
      Model.ListadeIngredientes = new List&lt;NutricionApp.Models.ListaIngredientes&gt;();
  }
  
  &lt;h2&gt;Create&lt;/h2&gt;
  
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  
  @using (Html.BeginForm()) {
      @Html.ValidationSummary(true)
      &lt;fieldset&gt;
          &lt;legend&gt;Platillo&lt;/legend&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.NombrePlatillo)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.NombrePlatillo)
              @Html.ValidationMessageFor(model =&gt; model.NombrePlatillo)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.idRestaurante)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.idRestaurante)
              @Html.ValidationMessageFor(model =&gt; model.idRestaurante)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.DescripcionPlatillo)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.DescripcionPlatillo)
              @Html.ValidationMessageFor(model =&gt; model.DescripcionPlatillo)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.esAprobado)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.esAprobado)
              @Html.ValidationMessageFor(model =&gt; model.esAprobado)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.esDisponible)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.esDisponible)
              @Html.ValidationMessageFor(model =&gt; model.esDisponible)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.precio)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.precio)
              @Html.ValidationMessageFor(model =&gt; model.precio)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.VigenciaPlatillo)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.VigenciaPlatillo)
              @Html.ValidationMessageFor(model =&gt; model.VigenciaPlatillo)
          &lt;/div&gt;
          &lt;!--&lt;table&gt;
          &lt;tr&gt;&lt;th&gt;Nombre&lt;/th&gt;&lt;/tr&gt;
          @@foreach (var item in (List&lt;NutricionApp.Models.ListaIngredientes&gt;)Session["Lista"])
                  {
              &lt;tr&gt;
              &lt;p&gt;
                  &lt;td&gt;@@item.ingrediente.NombreIngrediente&lt;/td&gt;
              &lt;/p&gt;
              &lt;/tr&gt;
          }
          &lt;/table&gt;--&gt;
          @Html.Partial("_Ingredientes", Model.);
          &lt;br /&gt;
          @Html.Partial("_ListaIngredientes", Model.ListadeIngredientes)
  
          &lt;p&gt;
              &lt;input type="submit" value="Create" /&gt;
          &lt;/p&gt;
  
      &lt;/fieldset&gt;
  }
  
  &lt;div&gt;
      @Html.ActionLink("Back to List", "Index")
  &lt;/div&gt;
  </code></pre>
  
  <p>And in my controller I have this:</p>
  
  <pre><code>//....
   public ActionResult _ListaIngredientes()
      {
          IEnumerable&lt;ListaIngredientes&gt; ListaDemo = new List&lt;ListaIngredientes&gt;();
          return View(ListaDemo);
      }
  
      public ActionResult _Ingredientes()
      {
          return View(db.Ingredientes.ToList());
      } 
  </code></pre>
  
  <p>In this case, db.Ingredients.ToList()); returns the data i need to show on the partial view. Problem is, when I try to display said list in my view, it tells me I have to pass a IEnumerable model corresponding to my view...</p>
  
  <p>If I access the PartialView from an URL, it shows me the data correctly. However if i try to do this from inside a View, it passes the Model it's currently using due to being strongly-typed. How can I pass the model i need (the list of my ingredients table, db.Ingredientes.ToList());</p>