title: ASP.NET MVC PartialView with List
body: <p>I am at my first MVC project. I want to create a page with a header and in this header to be placed a partial view with category list.</p>
  
  <p>This is what I did so far:
  I created the master page (_Home.cshtml). Than in Shared folder I created a View (Category.cshtml). See my picture.
  <img src="https://i.stack.imgur.com/BknAE.png" alt="enter image description here"></p>
  
  <p>My Category.cshtml content:</p>
  
  <pre><code>@model IEnumerable&lt;ArtSchool.Models.Category&gt;
  &lt;p&gt;
      @Html.ActionLink("Create New", "Create")
  &lt;/p&gt;
  &lt;table&gt;
  &lt;tr&gt;
      &lt;th&gt;
          @Html.DisplayNameFor(model =&gt; model.Name)
      &lt;/th&gt;
      &lt;th&gt;
          @Html.DisplayNameFor(model =&gt; model.Visible)
      &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.Name)
      &lt;/td&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.Visible)
      &lt;/td&gt;
      &lt;td&gt;
          @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
          @Html.ActionLink("Details", "Details", new { id=item.ID }) |
          @Html.ActionLink("Delete", "Delete", new { id=item.ID })
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>}</p>
  
  <p></p>
  
  <p>My master page file:</p>
  
  <pre><code>@{
  Layout = null;
  }
  
  &lt;!DOCTYPE html&gt;
  
   &lt;html&gt;
   &lt;head&gt;
  &lt;meta name="viewport" content="width=device-width" /&gt;
  &lt;title&gt;_Home&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div&gt;
  
      @Html.Partial("ASCX/Header")
  
      @Html.Partial("Category")
  
      @RenderBody()
  &lt;/div&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>When I run the project I got the error:</p>
  
  <p><img src="https://i.stack.imgur.com/0ZYEw.png" alt="enter image description here"></p>
  
  <p>I know that is a newbie question but it's my first MVC project.
  Thanks!</p>