title: How to dynamically load menu items in Layout or MasterPage in ASP.NET MVC?
body: <p>Hi I would like to dynamically load meny items in the _Layout.cshtml file.</p>
  
  <p>How do I do that? Can you point me to a code example doing that? Or something?</p>
  
  <p>I am not looking for any particular fancy way of doing this.</p>
  
  <p>Below I will describe my intention:</p>
  
  <p>I just want a list of different menu items rendering in the left side of the screen. Say there is a hierarchy of menu items in the form of</p>
  
  <p>Categories -> Types -> Brands -> Models.</p>
  
  <p>So intially just a list of the Category menu items render, then one chooses a Category and a list of Type menu items render, one choses a Type and a list of Brand menu items render, one chooses a Brand and a list of Model menu items render, like below:</p>
  
  <p>(The initial appearance of the menu)</p>
  
  <p>Categories:</p>
  
  <ul>
  <li>Cars</li>
  <li>Boats</li>
  <li>Bikes</li>
  <li>Motorbikes</li>
  </ul>
  
  <p>(Cars is chosen)</p>
  
  <p>Types:</p>
  
  <ul>
  <li>Coupe</li>
  <li>Truck</li>
  <li>Van</li>
  <li>Convertible</li>
  </ul>
  
  <p>(Coupe is chosen)</p>
  
  <p>Brands:</p>
  
  <ul>
  <li>BMW</li>
  <li>Volvo</li>
  <li>Ford</li>
  <li>Mercedes</li>
  </ul>
  
  <p>(BMW is chosen)</p>
  
  <p>Model:</p>
  
  <ul>
  <li>325i</li>
  <li>128i</li>
  <li>650i</li>
  <li>M6
  .</li>
  </ul>