can anybody point me in the right direction as to how I would go about implementing a hierarchical navigation menu which is driven by database? I don't want to re-invent the wheel here, so I was wondering if there is something that's already been done. I'm aware of the Menu control in asp.net, but from what I figure it won't work with MVC. Is there something that's already provided as part of the framework that I can leverage for this purpose? If not, then maybe a few links to point me in the right direction?
thanks.
LBushkin's idea is a good one. For ways to emit the <ul>
and <li>
tags from the database, have a look at the following blog posts:
ASP.NET MVC Recursive TreeView Helper
http://www.matthidinger.com/archive/2009/02/08/asp.net-mvc-recursive-treeview-helper.aspx
Rendering a TreeView using the ASP.NET MVC Framework http://mikehadlow.blogspot.com/2008/10/rendering-tree-view-using-mvc-framework.html
I personally use a modified version of Matt Hidinger's recursive TreeView Helper, and feed it a couple of IQueryable
s from my database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With