Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fourfinger 24 posts 44 karma points
    Feb 28, 2012 @ 16:22
    Fourfinger
    0

    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

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Feb 28, 2012 @ 21:39
    Jeroen Breuer
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft