Find out current page name

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.
2/22/2010 6:55:45 AM
Gravatar
Total Posts 2

Find out current page name

Hi

i was just wondering how to find out the current mojoportal page name? i have tried using System.Web.HttpContext.Current.Request.Url.AbsolutePath; but this always returns default.aspx?


Thanks

Phil

2/22/2010 8:47:12 AM
Gravatar
Total Posts 2253

Re: Find out current page name

Hi Phil,

The following will return the Page Name or Page Title if the Page Title Override is set:

PageSettings currentPage = CacheHelper.GetCurrentPage();
if(currentPage == null){ return; }
if(currentPage.PageTitle == "")
   lblPageName.Text = currentPage.PageName;
   else
      lblPageName.Text = currentPage.PageTitle;

HTH,
Joe D.

2/22/2010 9:10:35 AM
Gravatar
Total Posts 2

Re: Find out current page name

Brilliant thanks for that, was just what i was looking for!

 

Cheers

Phil

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