Determine selected Menu Item from Menu in User Control on Master Page

2 posts, 1 answers
  1. Bob
    Bob avatar
    10 posts
    Member since:
    Jun 2010

    Posted 13 Dec 2011 Link to this post

    Hello,
    I have a radmenu in a user control that is placed on several master pages.  I would like to be able to determine the selected item from that menu on my content pages.  I found the solution below which works well if the radmenu is placed on the master page.  I would like to avoid having to duplicate the radmenu on all my master pages and am wondering if anyone knows how I could modify this to be able to find the menu from the user control and then determine the selected item.

    http://www.telerik.com/community/forums/preview-thread/aspnet-ajax/menu/radmenu-masterpage-and-contentplaceholder-page.aspx
    Thanks,
    Bob
  2. Answer
    Bozhidar
    Admin
    Bozhidar avatar
    1103 posts

    Posted 14 Dec 2011 Link to this post

    Hello Bob,

    If you have a control inside a UserControl on a master page, you can access it from the content page with the following line:

    RadMenu menu = (RadMenu)((UserControl)Master.FindControl("UserControl1")).FindControl("RadMenu1");
    Regards,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top