Developer forum

Forum » Development » Get Parent page inside loop of ItemPulbisher

Get Parent page inside loop of ItemPulbisher

Hans Ravnsfjall
Hans Ravnsfjall


i am looping pages in an item publisher, and I am trying to get the parent of the current page inside the loop like this

string pageid=@i.GetInteger("ItemPublisher:Global.PageId").ToString();
var page = Dynamicweb.Content.Services.Pages.GetById(pageid);
var parentpage=Dynamicweb.Content.Services.Pages.GetById(page.ParentID);


But this gives an error like this

'PageService' does not contain a definition for 'GetById' and no accessible extension method...

I know what the message is saying, but I don´t know what gets me the id of the parent page.

Anyone who can help?



Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen

Hi Hans

The method is called GetPage - you should see that in your intellisense.

BR Nicolai


You must be logged in to post in the forum