More in this section
Forums / Sitefinity SDK / SiteMap.CurrentNode.Url is null

SiteMap.CurrentNode.Url is null

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 1 answered
  1. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    29 Apr 2011
    Link to this post
    Hi,

    The website I'm working on was upgraded to 4.1. Now I'm having some issues finding the current page URL. The way I have implemented my logic was using SiteMap.CurrentNode.Url But now in 4.1 current node is always null.

    I need an alternative solution to find the URL of the current page. I'm having this logic within a custom widget (.ascx).

    Thanks,
    Duneel
  2. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    29 Apr 2011
    Link to this post
    Try using SiteMapBase.GetCurrentUrl() instead of the SiteMap.CurrentUrl. Since SP1, I believe the SiteMap does not use the correct provider that Sitefinity uses. So you have to use the SiteMapBase class for pretty much everything you would normally use SiteMap for. If you use a SiteMapDataSource from ASP.NET, then you need to set the provider for it to SiteMapBase.GetCurrentProvider().

    Hope this helps.
    Answered
2 posts, 1 answered