We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,473 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to Set the SiteMapNode Title Dynamically from Master Page ? ASP.NET

In My Web.sitemap I have the following:

<siteMapNode url="~/Groups/ViewGroups.aspx" urlRoute="groups/{PostId}/{PostTitle}" />
</siteMapNode>

In my MasterPage I have implemented the ItemDataBound event to try and set the title of each page that implements the master page dynamically but for some reason the title is not being set.

protected void SiteMapPath1_ItemDataBound(object sender, SiteMapNodeItemEventArgs e)
{
    string CurrentNodeTitle = GetTitleFromDatabase();

    if (e.Item.ItemType == SiteMapNodeItemType.Current) {
         e.Item.SiteMapNode.Title = CurrentNodeTitle;
    }
}

If I set the title in the Web.sitemap then it works perfectly but when I set it using e.Item.SiteMapNode.Title = CurrentNodeTitle; the title is nto being set.

1
Contributor
1
Reply
6 Days
Discussion Span
9 Months Ago
Last Updated
3
Views
GFX010
Newbie Poster
9 posts since Dec 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

So there is no solution to this?

GFX010
Newbie Poster
9 posts since Dec 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0590 seconds using 2.7MB