This is a migrated thread and some comments may be shown as answers.

Highlight Active Page on Menu

2 Answers 249 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Wendy Hunt
Top achievements
Rank 2
Wendy Hunt asked on 05 Jan 2010, 10:26 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 06 Jan 2010, 10:21 AM
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
0
Wendy Hunt
Top achievements
Rank 2
answered on 06 Jan 2010, 03:47 PM
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
Tags
Menu
Asked by
Wendy Hunt
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Wendy Hunt
Top achievements
Rank 2
Share this question
or