Thank you for reply Juraj Ondrus!
If There isn't any way to fix this problem, i still have to use the steps mentioned in the article in my first post.But a page in my site have two or three parent pages so i have to switch base on page level to get page parent.
PageInfo parentpi = null;
switch (CMSContext.CurrentPageInfo.NodeLevel)
{
case 3: parentpi = PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, "", CMSContext.CurrentDocumentCulture.CultureCode, "", CurrentDocument.Parent.NodeID, false);
break;
case 4: parentpi = PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, "", CMSContext.CurrentDocumentCulture.CultureCode, "", CurrentDocument.Parent.Parent.NodeID, false);
break;
case 5: parentpi = PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, "", CMSContext.CurrentDocumentCulture.CultureCode, "", CurrentDocument.Parent.Parent.Parent.NodeID, false);
break;
}
Do you have any idea for my solution or other solution?
Thank you!
GiangLT3