Get page URL from pageId

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.
10/12/2007 9:49:14 AM
Gravatar
Total Posts 46

Get page URL from pageId

Hi Joe,
When a user has completed a survey and they click submit I would like to redirect them back to the start page that the module has been added to.
I retain the pageId throughout the survey, so is there an easy way to setup a redirect to a page by pageId or am I going to need to write a method + stored proc to get the url of the page from its ID and then do the redirect?
Cheers
Rob

10/12/2007 10:01:29 AM
Gravatar
Total Posts 18439

Re: Get page URL from pageId

Hi Rob,

You can eaily redirect to SiteRoot + "Default.aspx?pageid=" + pageID.ToString()

but that doesn't preserve the friendly url.

I'm going to add a helper method to make it easy to get the friendly url for the current page. It will be in svn within the next few days. I'll add it to SiteUtils so you'll be able to call it like

string currentPageUrl = SiteUtils.GetFriendlyUrl(CacheHelper.GetCurrentPage());

Something I've been meaning to do that your question has reminded me to go ahead and do.

Thanks,

Joe

10/12/2007 10:07:40 AM
Gravatar
Total Posts 46

Re: Get page URL from pageId

Hi Joe,

Thanks - that will be very useful for me.

Rob

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