title: Dynamic Navigation from object
body: <p>I'm working on a ASP.NET MVC3 web application and I want to create a navigation menu that has a sub menu created dynamically from an object. For example I have a Library object/model that contains a list of Books. I want my Navigation to dynamically populate a link to each of those books and display their titles.</p>
  
  <p>Ex:</p>
  
  <pre><code>Home
  Book List
   - Book 1
   - Book 2
   - Book 3
  About
  </code></pre>
  
  <p>I have this working by passing the Library object through ViewData from my Controller. My shared _Layout.cshtml page then reads the ViewData and populates the navigation menu. However the downside to this solution is that every method that returns a view in my controllers has to place the Library object into the ViewData. So I'm wondering if there is a better or simpler way to do this?</p>
  
  <p>I'm sure it can be done with jQuery, but maybe you all have a better idea.</p>