SiteMap.CurrentNode.Url is null
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
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.