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
r
Type: System.Web.HttpRequestA System.Web.HttpRequest object that represents the request.
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);