Top-parent pagenode of current page
Hi,
How can I obtain the "top-parent" / "top-root" of the actual page?
Hello ,
You can use while loop to get the top level parent
var actualNode = SiteMapBase.GetActualCurrentNode();while (actualNode.ParentNode != null) actualNode = actualNode.ParentNode as PageSiteNode;
using Telerik.Sitefinity.Web;namespace SitefinityWebApp.UserControls public partial class SubNaviTitle : System.Web.UI.UserControl protected void Page_Load(object sender, EventArgs e) var actualNode = SiteMapBase.GetActualCurrentNode(); while (actualNode.ParentNode != null && actualNode.ParentNode.Title != "Pages") actualNode = actualNode.ParentNode as PageSiteNode; Label1.Text = actualNode.Title;