Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

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

public static string OriginalBaseUrl(
	HttpRequest 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);
© 2015 Microsoft