ShowPath and redirecting to pages

Thread is closed for posting
4 posts, 0 answers
  1. 97AD96E1-EF11-4E30-BCDB-005E455D92B6
    97AD96E1-EF11-4E30-BCDB-005E455D92B6 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).
  • 63F75A2C-1F16-4AED-AFE8-B1BBD57646AD
    63F75A2C-1F16-4AED-AFE8-B1BBD57646AD avatar
    1572 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.
  • 724FF46F-0E25-47C9-AFC2-DBC4C45E957A
    724FF46F-0E25-47C9-AFC2-DBC4C45E957A avatar
    42 posts
    Member since:
    Nov 2007

    Posted 10 Jun 2008 Link to this post

    Hi, is there a client side via javascript equivalent?
  • 7ECFE2AE-669B-42F5-B863-CECDEE6FD6D6
    7ECFE2AE-669B-42F5-B863-CECDEE6FD6D6 avatar
    2992 posts
    Member since:
    Jul 2015

    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

    This Code Library is part of the product documentation and subject to the respective product license agreement.