Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 768707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:13:21+00:00 2026-05-14T18:13:21+00:00

I have been asked to update the menu on a website we maintain. The

  • 0

I have been asked to update the menu on a website we maintain. The website uses Castle Windors Monorail and NVelocity as the template. The menu is currently rendered using custom made subclasses of ViewComponent, which render li elements. At the moment there is only one (horizontal) level, so the current mechanism is fine.

I have been asked to add drop down menus to some of the existing menus. As this is the first time I have seen Monorail and NVelocity, I’m a little lost.

What currently exists:

<ul>
    #component(MenuComponent with "title=Home" "hover=autoselect" "link=/")
    #component(MenuComponent with "title=Videos" "hover=autoselect")
    #component(MenuComponent with "title=VPS" "hover=autoselect" "link=/vps")                                   
    #component(MenuComponent with "title=Add-Ons" "hover=autoselect" "link=/addons")                    
    #component(MenuComponent with "title=Hosting" "hover=autoselect" "link=/hosting")                           
    #component(MenuComponent with "title=Support" "hover=autoselect" "link=/support")                           
    #component(MenuComponent with "title=News" "hover=autoselect" "link=/news")
    #component(MenuComponent with "title=Contact Us" "hover=autoselect" "link=/contact-us") 
</ul>

Is it possible to have nested MenuComponents (or a new SubMenuComponent) something like:

<ul>
    #component(MenuComponent with "title=Home" "hover=autoselect" "link=/")
    #component(MenuComponent with "title=Videos" "hover=autoselect")
    #blockcomponent(MenuComponent with "title=VPS" "hover=autoselect" "link=/vps")                                  
        #component(SubMenuComponent with "title="Plans" "hover=autoselect" "link=/vps/plans")
        #component(SubMenuComponent with "title="Operating Systems" "hover=autoselect" "link=/vps/os")
        #component(SubMenuComponent with "title="Supported Applications" "hover=autoselect" "link=/vps/apps")
    #end
    #component(MenuComponent with "title=Add-Ons" "hover=autoselect" "link=/addons")                    
    #component(MenuComponent with "title=Hosting" "hover=autoselect" "link=/hosting")                           
    #component(MenuComponent with "title=Support" "hover=autoselect" "link=/support")                           
    #component(MenuComponent with "title=News" "hover=autoselect" "link=/news")
    #component(MenuComponent with "title=Contact Us" "hover=autoselect" "link=/contact-us") 
</ul>

I need to draw the sub menu (ul and li elements) inside the overridden Render method on MenuComponent, so using nested ViewComponent derivatives may not work. I would like a method keep the basically declarative method for creating menus, if at all possible.

edit: I can use Context.RenderBody() to render the nested ViewComponent derivitives, but they’re being rendered before the parent. I guess the rending of the sub menus need to somehow hook into the same output as the parent?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:13:22+00:00Added an answer on May 14, 2026 at 6:13 pm

    My original render method looked like

    public override void Render()
    {
        var buffer = new StringBuilder();           
        var extraClass = _hoverState == MenuHoverState.Selected ? "class=\"Selected\"" : "";
    
        // Menu Item Start
        buffer.Append("<li><a href=\"" + ComponentParams["link"] + "\"" + extraClass + ">");
    
        // Menu Text
        buffer.Append(ComponentParams["title"]);
    
        // Menu Item End
        buffer.Append("</a></li>");                     
        RenderText(buffer.ToString());
    }
    

    I needed to hook into the Context.Writer:

    public override void Render()
    {
        var buffer = new StringBuilder();           
        var extraClass = _hoverState == MenuHoverState.Selected ? "class=\"Selected\"" : "";
    
        // Menu Item Start
        buffer.Append("<li><a href=\"" + ComponentParams["link"] + "\"" + extraClass + ">");
    
        // Menu Text
        buffer.Append(ComponentParams["title"]);
    
        // Menu Item End
        buffer.Append("</a><ul class=\"subMenu\" style=\"display:none;\">");                        
        Context.Writer(buffer.ToString());
        Context.RenderBody(Context.Writer);
        Contet.Writer("</ul></li>");    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I have been asked to remove a menu item on a website running
I have been asked to update a legacy website. I was originally build in
I am new to LINQ and have been asked to update our existing legacy
I have been asked to update some old code I worked on years ago.
I have been asked to lend a hand on a hobby project that a
I have been asked to standardize the screen saver and desktop background used by
I have been asked to develop some usercontrols in ASP.NET that will at a
I have been asked to audit any/all changes in a MySQL table. Does anyone
I have been asked to provide information on available techniques for assessing our current,
I have been asked to setup a course leaflet system for a college. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.