How to change text in href in radmenu

2 posts, 0 answers
  1. Surya CD
    Surya CD avatar
    18 posts
    Member since:
    Apr 2010

    Posted 22 Aug 2012 Link to this post

    Hi,
    I am doing a site in Sitefinity5. I am using telerik radmenu to display menu items. Here is my code.
    public void HorizontalRadMenu_ItemDataBound(object sender, RadMenuEventArgs e)
        {
            string[] strNavigationPages = { "Menu1", "Menu2", "Menu3", "Menu4", "Menu5", "Menu6", "Menu7", "关于我们", "联系我们", "视频", "租赁业务", "客户服务", "手持式 XRF技术" };
            
            if (e.Item != null)
            {
                if (e.Item.Level == 0)
                {
                    parentPageId = ((Telerik.Sitefinity.Web.PageSiteNode)(e.Item.DataItem)).Id.ToString();
                }
     
                string currentPageId = ((Telerik.Sitefinity.Web.PageSiteNode)(e.Item.DataItem)).Id.ToString();
                string findThisString = e.Item.Text;
     
                int strIndex = -1;
                int flag = -1;
                if (!String.IsNullOrEmpty(findThisString) && ((Telerik.Sitefinity.Web.PageSiteNode)(e.Item.DataItem)).ShowInNavigation)
                {
                    for (int strNumber = 0; strNumber < strNavigationPages.Length; strNumber++)
                    {
                        strIndex = strNavigationPages[strNumber].IndexOf(findThisString);
                        if (strIndex > -1)
                        {
                            flag = 1;
                          //e.Item.NavigateUrl
     
                          
                        }
                    }
     
                    if (flag == -1 && ((Telerik.Sitefinity.Web.PageSiteNode)(e.Item.DataItem)).ParentKey != parentPageId && e.Item.Level < 2)
                    {
                        e.Item.Remove();
                    }
                }
                else
                {
                    e.Item.Remove();
                }
            }
    }
      I need to show the language folder appended to the href in menu



    Is there any way. Can anybody pls help me.

    Thanks,
    Surya. 
  2. Ivan Dimitrov
    Admin
    Ivan Dimitrov avatar
    78 posts

    Posted 24 Aug 2012 Link to this post

    Hello,

    You can use client side  set_navigateUrl or server side NavigateUrl property of the RadMenu item to override the link destination.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top