How to create a link to "current site"

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.
6/4/2007 10:51:01 AM
Gravatar
Total Posts 488

How to create a link to "current site"

I need to create link to the page on current site (using folder-based sites).

So if I am now at mydomain/mysite, the link is http://mydomain/mysite/mypage.aspx

How should I perform this?

6/4/2007 11:04:25 AM
Gravatar
Total Posts 18439

Re: How to create a link to "current site"

You mean In code?

mojoBasePage and SiteModuleControl base classes have a property SiteRoot which will correctly resolve the folder name of the current site so the link would be SiteRoot + "/mypage.aspx";

There is also a function SiteUtils.GetNavigationRoot() that will return the correct site root including visrutal folder name for the current site.

Note that its only the pages that need to use the virtual folder path as part of the url, images, script etc must still use the actual site root like WebUtils.GetSiteRoot() or in mojoBasePage and SiteModuleControl we have property ImageSiteRoot

Or a fully qualified link will always work for pages. http://mydomain/mysite/mypage.aspx

Joe

 

6/4/2007 11:33:12 AM
Gravatar
Total Posts 488

Re: How to create a link to "current site"

Yes, I wanted to do that from code. Thanks.

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