+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Get PageNode ID in Web Api

Get PageNode ID in Web Api

2 posts, 0 answered
  1. David
    David avatar
    10 posts
    Registered:
    20 Jul 2014
    14 Aug 2014
    Link to this post

    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.

  2. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    09 Dec 2016
    20 Aug 2014
    Link to this post
    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
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
2 posts, 0 answered