title: How to create foreach loop of a Model in a PartialView? (MVC.NET)
body: <p><strong><em>Beginner's Question:</em></strong> 2 tables on my db: Products, Categories. I created a View of Products. And I have a Sidebar Menu as a Partial View.</p>
  
  <pre><code>PartialView Name: _SidebarMenu
  Layout Name:      _AdminLayout
  </code></pre>
  
  <p>I want to list my categories in _SidebarMenu dynamically. So I tried this in _SidebarMenu:</p>
  
  <pre><code>@model IEnumerable&lt;ProjectName.MVCWebUI.Models.Categories&gt;
  
  @foreach (var item in Model)
       {
          &lt;li&gt;&lt;a href="#"&gt;@item.CategoryName&lt;/a&gt;&lt;/li&gt;
       }
  </code></pre>
  
  <p><strong>But I got a Server Error:</strong> </p>
  
  <p><em>The model item passed into the dictionary is of type 'System.Collections.Generic.List`1 [ProjectName.MVCWebUI.Models.Products]', but this dictionary requires a model item of type 'ProjectName.MVCWebUI.Areas.Admin.Models.AdminMenuContent'.</em></p>
  
  <p><strong>How can I list a different Model rather than a Model in a rendering View?</strong></p>