This topic has not yet been rated - Rate this topic

SPWeb.OriginalBaseUrl Method

Returns the base URL for the current request.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedExternalType)]
public static string OriginalBaseUrl(
	HttpRequest r
)

Parameters

r
Type: System.Web.HttpRequest
A System.Web.HttpRequest object that represents the request.

Return Value

Type: System.String
A string that contains the base URL.

The OriginalBaseUrl method is a static method and is called directly on the SPWeb class.

The following code example uses the OriginalBaseUrl method to display the base URL for the current request.

string strBaseUrl = SPWeb.OriginalBaseUrl(Request);
Response.Write(strBaseUrl);
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ