SiteUtils.GetCurrentPageUrl() doesn't return full url on localized folder based sites

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/28/2012 3:36:47 PM
Gravatar
Total Posts 1

SiteUtils.GetCurrentPageUrl() doesn't return full url on localized folder based sites

I need to get the full URL on all of my localized sites & my English sites.  It works correctly on the English site but only returns the relative url on the localized sites.  Is this correct behavior?  If so what function can I use to call the current domain?  I would love if I could use the same function on every site.  Thanks.

 

Lindsay

2/29/2012 9:12:38 AM
Gravatar
Total Posts 18439

Re: SiteUtils.GetCurrentPageUrl() doesn't return full url on localized folder based sites

Hi Lindsay,

Generally relative urls are best both for links and for redirects, however if for some reason you really need to get a fully qualified url, you can pass the relative url into one of our utility methods.

using mojoPortal.Web.Framework;

string relativeUrl = "/foo.aspx";

bool forceHttps = false;

string fullUrl = WebUtils.ResolveServerUrl(relativeUrl, forceHttps);

If you pass in an url that is already fully qualified it just returns the url you passed in so it is safe to use this method even if you are unsure of whether you are passing in a relative url or not.

Note that SiteUtils.GetCurrentPageUrl() is designed only for CMS pages, ie the pages that make up the main menu. Its primary use is for returning to the cms page from a feature supporting page or edit page in features that have supporting pages like the blog, forums etc.

Hope that helps,

Joe

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