ShowPath and redirecting to pages

Thread is closed for posting
4 posts, 0 answers
  1. Peter Georgiev
    Peter Georgiev avatar
    14 posts
    Member since:
    Jan 2006

    Posted 11 Aug 2006 Link to this post

    Requirements

    RadControls version

    v4.x or Telerik.Web.UI v2007.3 1425

    .NET version

    2.0

    Visual Studio version

    2005

    programming language

    C#

    browser support

    all browsers supported by RadMenu

    To convert code
    from posted project(s)
    Telerik online converter
      
  2. PROJECT DESCRIPTION 

    This project shows how to implement the Show Path functionality when some of the menu items use the NavigateUrl property (handled in the Page Load event). The case when a menu item only postbacks with no redirection to another page, is also covered (handled in the ItemClicked event).
  • Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 26 May 2008 Link to this post

    The show path implementation has been updated to use the HighlightPath() method. The old approach is commented to show alternative solution in case you want to use your custom css class for highlighting the items.
  • max
    max avatar
    42 posts
    Member since:
    Nov 2007

    Posted 10 Jun 2008 Link to this post

    Hi, is there a client side via javascript equivalent?
  • Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 10 Jun 2008 Link to this post

    For RadMenu for ASP.NET AJAX you can use the following javascript code:

    <script type="text/javascript">  
    function pageLoad()  
    {  
        var menu = $find("<%= RadMenu2.ClientID %>");  
        var href = window.location.href;  
        var index = href.lastIndexOf("/");  
        var pageURL = href.substring(index + 1);  
          
        var items = menu.get_items();  
        var item = null;  
          
        for (var i = 0; i < items.get_count(); i++)  
        {  
            if (items.getItem(i).get_navigateUrl() == pageURL)  
            {  
                item = items.getItem(i);  
                break;  
            }      
        }         
          
        if (item)  
        {  
            while (item != menu)  
            {  
                var element = item.get_linkElement();  
                element.className += " rmFocused";  
                item = item.get_parent();  
            }  
        }       
    }  
    </script> 


    Regards,
    Veskoni
    the telerik team
  • Back to Top