SPWeb.OriginalBaseUrl method

Returns the base URL for the current request.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Shared Function OriginalBaseUrl ( _
    r As HttpRequest _
) As String
'Usage
Dim r As HttpRequest
Dim returnValue As String

returnValue = SPWeb.OriginalBaseUrl(r)
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