Retrieve current navigation Code

I need to retrieve the navigation code that is in the sitemap. I need to do this because the base.IsHomepage does not work, it always returns false.

Is there a simple way to retrieve it from the site or any page.

Broc

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

What are you trying to achieve?

Hi Broc,

What are you trying to achieve?  The navigation code is defined in the Properties section on a navigation item.  You can update this value to anything that makes sense to you.

However, there may be better ways to go about finding the home page.  For instance, this is defined within the website.  You should be able to retrieve the website in code sort of like this: 

((Asi.Web.UI.DisplayPageBase)Page).iMISWebsite

Once you have the website, it has a property on it called HomePageHierarchyKey which you should be able to use to retreive the navigation.

NavigationHierarchy homepage = NavigationHierarchyController.NavigationHierarchy(website.HomePageHierarchyKey.Value, BusinessContainer, false, DocumentStatusCode == DocumentStatus.Published);

Hope this helps,
Courtney Robertson