title: Render strongly type partial view in layout MVC4 razor
body: <p>I have some issues with rendering strongly type partial view in layout view.</p>
  
  <ol>
  <li>partial view (menu) is band with model Menu</li>
  <li>this partial view I want to render in _layout.chtml, so it 'll be avliable in all views.</li>
  </ol>
  
  <p>I want to make avalible the partial view(menu) in all pages/view. the problem I face is where to put the action for partial view to populate it from DB on page load.</p>
  
  <p>thanks</p>
  
  <pre><code>---------------------- My code is--------------------
  partial view inside shared folder.
  @model List&lt;Menu&gt;
  @foreach(var item in Model){// here is the html/model item inside to display}
  --------------------------------------
  HomeView.chtml inside home folder
  
  @model List&lt;homemodel&gt;
  .... here goes html code/ plus homemodel loop/data etc.
  ------------------------------
  HomeController{
  public ActionResult HomeView()
  {
  .........return view();
  }
  public PartialViewResult partialmenu()
  {
  // data from db
  return partialview(partialobject as list);
  }
  
  ------------------------
  layoutview.chtml
  
  --html code---
  {@ Html.renderpartial("partialview");}
  .. html code...
  </code></pre>