Share via


WebUrlFromPageUrl Method

The WebUrlFromPageUrl method of the Webs service returns the URL of the parent site for the specified page URL.

Parameters

pageUrl   A string that contains the absolute URL of the page.

Return Value

A string that contains the site URL.

Remarks

If the page URL is "http://Server_Name/Web_One/Web_Two/Web_Three/Lists/Events/Allitems.aspx", the WebUrlFromPageUrl method returns "http://Server_Name/Web_One/Web_Two/Web_Three". If the Web site does not exist on the server, the top-level site is returned.

Example

The following code example displays the site URL for a specified page URL.

Requirements

Platforms: Microsoft Windows Server 2003

Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/Webs.asmx