How to make a collapsible menu webcontrol?

Posted on 2008-11-14
Last Modified: 2013-12-17
I havent made a webcontrol before so a bit confused on how to do it. I want to make a collapsible menu webcontol for my asp 2.0 webpage. Also after making the webcontrol would it be possiable to Hide and show certain sections of it on pageload based on a if statement in my C# code?

Like: If (roles = cook)
                  hide management reports
                  show todays events and menu choices
Question by:Figle
    LVL 20

    Expert Comment

    Hi Figle,

    It is definitely possible to show/hide controls, using:

    Control.Visible = True | False

    Would that work? What type of control are you using for the individual sections?


    Author Comment

    I dont have the control yet, not quite sure as to how to make it. But it would be a collapsible menu with 1 main section and various subsections that would expand down from it. So with this i could make some of the subsections that drop down be hidden with others show?  Could you give me a example on how this would be done or direct me to some helpfull references please?
    LVL 20

    Accepted Solution


    I think that the best way would be to use the default Menu control and, if you need something slightly different, just create a control inheriting from it:

    ASP.NET Menu Control Overview:

    Developing Custom ASP.NET Server Controls:     

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! How to Know You are Making a Difference at EE In August, 2013, one …
    Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
    This video teaches users how to migrate an existing Wordpress website to a new domain.
    Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now