4 Replies - 4524 Views - Last Post: 25 August 2012 - 06:51 AM Rate Topic: -----

#1 skyxn3t  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 14-August 12

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

Posted 16 August 2012 - 04:14 PM

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 then it works perfectly but when I set it using e.Item.SiteMapNode.Title = CurrentNodeTitle; the title is nto being set.

Is This A Good Question/Topic? 0
  • +

Replies To: How to Set the SiteMapNode Title Dynamically from Master Page ? ASP.N

#2 skyxn3t  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 14-August 12

Re: How to Set the SiteMapNode Title Dynamically from Master Page ? ASP.N

Posted 23 August 2012 - 03:49 PM

So there's no solution to this? You can't assign a sitemappath title dynamically ?
Was This Post Helpful? 0
  • +
  • -

#3 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 441
  • View blog
  • Posts: 1,488
  • Joined: 28-April 09

Re: How to Set the SiteMapNode Title Dynamically from Master Page ? ASP.N

Posted 24 August 2012 - 06:00 PM

Have you walked through it with the debugger to verify what value is coming back from the database?
Was This Post Helpful? 0
  • +
  • -

#4 skyxn3t  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 14-August 12

Re: How to Set the SiteMapNode Title Dynamically from Master Page ? ASP.N

Posted 24 August 2012 - 11:09 PM

View PostNakor, on 24 August 2012 - 06:00 PM, said:

Have you walked through it with the debugger to verify what value is coming back from the database?


Thanks for the reply
yes, I even set it to a literal string but it sill is not setting the title of the Sitemappath. Do you know what might be the problem here?
Was This Post Helpful? 0
  • +
  • -

#5 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 441
  • View blog
  • Posts: 1,488
  • Joined: 28-April 09

Re: How to Set the SiteMapNode Title Dynamically from Master Page ? ASP.N

Posted 25 August 2012 - 06:51 AM

I'm not real familiar with making dynamic changes to the sitemap node, however here's a link I found that seemed pretty informative.

This post has been edited by Nakor: 25 August 2012 - 06:52 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1