SiteMap.CurrentNode.Url is null

Posted by Community Admin on 05-Aug-2018 14:43

SiteMap.CurrentNode.Url is null

All Replies

Posted by Community Admin on 29-Apr-2011 00:00

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

Posted by Community Admin on 29-Apr-2011 00:00

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.

This thread is closed