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

Syntax

'Declaration
<SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedExternalType)> _
Public Shared Function OriginalBaseUrl ( _
    r As HttpRequest _
) As String
'Usage
Dim r As HttpRequest
Dim returnValue As String

returnValue = SPWeb.OriginalBaseUrl(r)
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedExternalType)]
public static string OriginalBaseUrl(
    HttpRequest r
)

Parameters

Return Value

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

Remarks

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

Examples

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

Dim baseURL As String = SPWeb.OriginalBaseUrl(Request)

Response.Write(baseURL) 
string strBaseUrl = SPWeb.OriginalBaseUrl(Request);
Response.Write(strBaseUrl);

See Also

Reference

SPWeb Class

SPWeb Members

Microsoft.SharePoint Namespace