PortalApplication.GetContext Method (PortalSite, PortalZone)
Gets a reference to a PortalContext object that represents the current application context for the specified portal site and portal zone.
Namespace: Microsoft.SharePoint.Portal
Assembly: Microsoft.SharePoint.Portal (in Microsoft.SharePoint.Portal.dll)
Syntax
'Declaration
Public Shared Function GetContext ( _
site As PortalSite, _
zone As PortalZone _
) As PortalContext
'Usage
Dim site As PortalSite
Dim zone As PortalZone
Dim returnValue As PortalContext
returnValue = PortalApplication.GetContext(site, _
zone)
public static PortalContext GetContext(
PortalSite site,
PortalZone zone
)
Parameters
- site
Type: Microsoft.SharePoint.Portal.Topology.PortalSite
A PortalSite object that represents a portal site.
- zone
Type: Microsoft.SharePoint.Portal.Topology.PortalZone
A member of the PortalZone enumeration that represents the portal zone.
Return Value
Type: Microsoft.SharePoint.Portal.PortalContext
A PortalContext that represents the current application context.
Remarks
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). |