PortalApplication.GetContext Method (Guid)
Gets a reference to a PortalContext object that represents the current application context for the specified GUID.
Namespace: Microsoft.SharePoint.Portal
Assembly: Microsoft.SharePoint.Portal (in Microsoft.SharePoint.Portal.dll)
Syntax
'Declaration
Public Shared Function GetContext ( _
siteId As Guid _
) As PortalContext
'Usage
Dim siteId As Guid
Dim returnValue As PortalContext
returnValue = PortalApplication.GetContext(siteId)
public static PortalContext GetContext(
Guid siteId
)
Parameters
- siteId
Type: System.Guid
A globally unique identifier.
Return Value
Type: Microsoft.SharePoint.Portal.PortalContext
A PortalContext object that represents the current application context.
The following table describes the exception types.
Exception Type |
Condition |
---|---|
InvalidOperationException |
The System.Web.HttpContext.Current static property is a null reference (Nothing in Visual Basic). |