Highlight Active Page on Menu

3 posts, 1 answers
  1. Wendy Hunt
    Wendy Hunt avatar
    50 posts
    Member since:
    Nov 2009

    Posted 05 Jan 2010 Link to this post

    Hi -

    Is there a way to have the active page highlighted in the menu?

    Here is my code:
    <div style="float: left; margin-top: 13px; margin-right: 80px;">  
        <telerik:RadMenu ID="RadMenu1" runat="server" Skin="Vista"   
          style="z-index: 1; left: 126px; top: 91px; position: absolute;">  
          <Items> 
            <telerik:RadMenuItem Text="Search" runat="server" NavigateUrl="Search.aspx">  
            </telerik:RadMenuItem> 
            <telerik:RadMenuItem Text="MOU" runat="server" NavigateUrl="MOU.aspx">  
            </telerik:RadMenuItem> 
            <telerik:RadMenuItem Text="Contract" runat="server" NavigateUrl="Contract.aspx">  
            </telerik:RadMenuItem> 
            <telerik:RadMenuItem Text="SOI" runat="server" NavigateUrl="SOI.aspx">  
            </telerik:RadMenuItem> 
            <telerik:RadMenuItem Text="Create" runat="server" NavigateUrl="Create.aspx">  
            </telerik:RadMenuItem> 
          </Items> 
        </telerik:RadMenu> 
      </div> 

    If I am on the Contract page, I would like for the menu item to be highlighted (or something to show the page is active, in the menu).  Is this possible with a property?

    Thanks!
    wen
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 Jan 2010 Link to this post

    Hi Wen,

    Check out the following code library submission links, the first which explains on how to implement the Show Path functionality when the  NavigateUrl property for menu items are set for the RadMenu and the second which shows both breadcrumb and show path functionalities achieved with the server API of RadMenu placed in a master page.
    ShowPath and redirecting to pages
    Breadcrumb and Show Path for RadMenu in a master page, NavigateUrl set for all menu items

    Hope these provide necessary insights.
    -Princy
  3. Wendy Hunt
    Wendy Hunt avatar
    50 posts
    Member since:
    Nov 2009

    Posted 06 Jan 2010 Link to this post

    Thanks Princy!  You lead me right to it. 

    Here is my code snippet that works from my page_load (master page):
    if (!this.IsPostBack)     
    {     
                RadMenuItem item = RadMenu1.FindItemByUrl(Request.Url.PathAndQuery);     
                if (item != null)     
                {     
                  item.HighlightPath();     
                }     
    }    
     

    wen
Back to Top