Get properties of currentPage's parent

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
1/18/2010 12:48:55 PM
Gravatar
Total Posts 190

Get properties of currentPage's parent

Hi All,

Anyone know a quick and dirty way to get the PageName property of the current page's parent page?

Thanks,

John

1/18/2010 1:04:08 PM
Gravatar
Total Posts 190

Re: Get properties of currentPage's parent

OK, I'm sorry. This is basic .NET stuff.

SiteMap.CurrentNode.ParentNode.Title

1/18/2010 2:36:21 PM
Gravatar
Total Posts 190

Re: Get properties of currentPage's parent

This is along the same topic so I'll just add it here. Is there an easy way to get the level of the current siteMapNode without a looping and counting?

Thanks again

1/19/2010 1:31:37 PM
Gravatar
Total Posts 18439

Re: Get properties of currentPage's parent

I'm just going by memory but I think SiteMapNode has a .Depth property

Hope it helps,

Joe

1/19/2010 1:39:57 PM
Gravatar
Total Posts 190

Re: Get properties of currentPage's parent

I did see a currentPage.DepthIndicator property, but it doesn't have any value. Something else might have changed that is causing that property to be no long populated. (Could it be a problem that I'm accessing it from a user control? Although the other page properties seem to be showing up fine.)

1/19/2010 1:44:15 PM
Gravatar
Total Posts 18439

Re: Get properties of currentPage's parent

Cast the SiteMapNode as mojoSiteMapNode and then you will have a.Depth property.

mojoSiteMapNode n = (mojoSiteMapeNode)SiteMap.CurrentNode;

then use n.Depth

Hope it helps,

Joe

1/19/2010 2:04:55 PM
Gravatar
Total Posts 190

Re: Get properties of currentPage's parent

Aha! Thanks again.

You must sign in to post in the forums. This thread is closed to new posts.