Get PageNode ID in Web Api
Hello all,
I have some of problems when using web Api in Sitefinity 7.0. I can get the PageNode ID in APIController with the code below:
var currentNode = Telerik.Sitefinity.Web.SiteMapBase.GetActualCurrentNode();
PageNode pageNode = null;
if (currentNode != null)
var manager = PageManager.GetManager();
pageNode = manager.GetPageNode(currentNode.Id);
Thanks all for helps.
Hello David,
Can you please provide more details about your use case scenario and the exact functionality you would like to achieve. How do you access the web api controller. If you are trying to access the Get action of the api controller, for example http://yourdomain.com/api/<controller>, and withing this Get action you are trying to get the current page, Sitefinity will try to find a page which has url http://yourdomain.com/api/<controller>. Since there is not a page with this url the result will be null.
Regards,
Sabrie Nedzhip
Telerik