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

Forums / General Discussions / Menu title in each page

Menu title in each page

4 posts, 0 answered
  1. Vangelis
    Vangelis avatar
    153 posts
    Registered:
    07 Jan 2006
    29 Aug 2007
    Link to this post
    Hi,

    Is there a way to add in each page Menu title in each page?

    Best regards

    Vagelis
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    30 Aug 2007
    Link to this post
    Hi Vagelis,

    Could you please specify what exactly you want to achieve? It is not quite clear what you mean by  “menu title”? Do you mean “page title” or something else? Any information that you might consider useful is welcome.

    Thanks for your cooperation in advance.

    Sincerely yours,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Vangelis
    Vangelis avatar
    153 posts
    Registered:
    07 Jan 2006
    30 Aug 2007
    Link to this post
    Hi Pepy,

    What actually I ask is the title of page that is on panelbar, treeview and all navigation controls etc.

    Best regards

    Vagelis
  4. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    30 Aug 2007
    Link to this post
    Hi Vagelis Kretsimos,

    You can do that using the SiteMap and a user control. In the user control, just create a label (or another control that you want to display the title in) and in on Page_Load set its text property by getting it from the sitemap. Here is my user control:

    ASPX
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="SampleText.ascx.cs" Inherits="UserControls_SampleText" %> 
     
    <asp:Label ID="title" runat="server"></asp:Label> 

    C# Codebehind
    if (SiteMap.CurrentNode != null)  
        this.title.Text = SiteMap.CurrentNode.Title; 

    Note that you need the null check, in case you use the control in a template, where Sitemap.CurrentNode returns null. I think this would be its most common usage.

    Greetings,
    Slavo
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
4 posts, 0 answered