Re: retrieving the root URL of the current site?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jim Duncan (sorry_at_no.email)
Date: 06/27/04


Date: Sat, 26 Jun 2004 20:35:00 -0700

SPWeb myWeb = SPControl.GetContextWeb(Context);
string myLayoutsFolder = myWeb.Url + "_layouts";

"Jéjé" <willgart@BBBhotmailAAA.com> wrote in message
news:ObyA5n7WEHA.2840@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I've a webpart which relay some process to an ASPX page under the
> /_layouts/MyFolder virtual folder.
>
> To keep the right menu at the top of the ASPX page I must call the
_Layouts
> of the right folder.
>
> For example my calling page is in the sub site Toto:
> http://localhost/subsite/toto/mypage.aspx
>
> My webpart creates an hyperlink to the "myprocess.aspx" page:
> http://localhost/_layouts/myfolder/myprocess.aspx
>
> What is missing is the "subsite/toto" information in my URL!
> So the complete URL of the current sub site.
> So I want to link to this page:
> http://localhost/subsite/toto/_layouts/myfolder/myprocess.aspx
>
> How to retrieve the complete URL to call the right _layouts folder?
> (retrieving http://localhost/subsite/toto)
>
> thanks.
>
> Jerome.
>
>



Relevant Pages

  • Re: Site Definition Customization
    ... Not with just one, and yes, you have to modify every aspx page that you want ... each typ eof site template to look like. ... Site Settings and such are under the _layouts folder so those would have to ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: Need halp for MOSS
    ... The best practice for deploying is to create a folder in the _layouts folder and copy the aspx file there. ... Use the SPList and SPListItem classes to manipulate the doc libs. ... I have developed an .aspx page which consist of all metadata fields of ...
    (microsoft.public.sharepoint.portalserver)
  • Re: print functionality for lists
    ... > You can create one aspx page in _layouts folder, placing one data grid in ... > print the data in the data grid. ...
    (microsoft.public.sharepoint.portalserver.development)
  • Article / Example for Adding a simple ASPX page to a SPPS Site
    ... I am looking for a link to an example or article on adding a simple aspx ... would open a new window to an ASPX page we have written with further ... So I am just looking form information on what it takes. ... How do I register all this to make it available from any site or sub site. ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: ASPX page in SharePoint Portal
    ... Create an application directly in layouts folder. ... display errors, but i did it and still failed ... Now you can navigate to this page. ... You can put your .ASPX page in the following folder: ...
    (microsoft.public.sharepoint.portalserver)