1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / editing the code.

editing the code.

2 posts, 0 answered
  1. Muhammad Shoaib
    Muhammad Shoaib avatar
    12 posts
    Registered:
    11 May 2009
    26 Oct 2009
    Link to this post
    You can rename or hide some pages by subscribing for ItemDataBound event of the SiteMenu control then getting the RadMenuItem as a DataItem. Note that if you hide any parent - root item, its childs will be also hidden.

    sample code


    public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e)
       {
           CmsSiteMapNode smNode = e.Item.DataItem as CmsSiteMapNode;
           if (smNode != null && e.Item.Text == "oldtext")
           {
            e.Item.Text = "newtext";
           }
       }
    I Want some information about the above code snippet that from where we will write this code, ie in master page code behind file or the page's aspx.cs file.RegardsMuhammad Shoaib
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    26 Oct 2009
    Link to this post
    Hi Muhammad Shoaib,

    As I see we were talking about SiteMenu control. You will find the control declarationa nd its code behind under Sitefinity/UserControls/Navigation35 folder.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered