I'm trying to build a usercontrol to create my menu dynamically. Since the menu has to fetch values from an SQL database to populate the sub menus.
So, 'home', 'buy', 'sell', 'search' etc are static, but the submenu's for buy and sell are items fetched from an SQL database.
So i figured I'd use a usercontrol with a literal to generate this? (Is there a better way?)
Now, when I debug the control it's obvious I can't get to the xml containing the nodes.
Is there any way that I could make visual studio compile my usercontrol directly into my Umbraco folder? So I can press build, and immediatly refresh my homepage of umbraco to see the results?
Usercontrols and debuggging them in Umbraco
Hello,
I'm trying to build a usercontrol to create my menu dynamically. Since the menu has to fetch values from an SQL database to populate the sub menus.
So, 'home', 'buy', 'sell', 'search' etc are static, but the submenu's for buy and sell are items fetched from an SQL database.
So i figured I'd use a usercontrol with a literal to generate this? (Is there a better way?)
Now, when I debug the control it's obvious I can't get to the xml containing the nodes.
Is there any way that I could make visual studio compile my usercontrol directly into my Umbraco folder? So I can press build, and immediatly refresh my homepage of umbraco to see the results?
Thanks, Christophe
If you're using a usercontrol you could use things like a repeater of listview to display items if they are IEnumerable, but perhaps it's easier to use Razor here. Have a look at this Razor menu example: http://our.umbraco.org/forum/developers/razor/28479-Razor-menu-performance-(v4)?p=3#comment108221. It uses custom objects, but it could also be objects from a SQL database.
Jeroen
is working on a reply...