Partager via


PortalApplication.GetContext, méthode (Guid, PortalZone) (Microsoft.SharePoint.Portal)

Gets a reference to a PortalContext object that represents the current application context for the specified GUID and portal zone.

Espace de noms : Microsoft.SharePoint.Portal
Assembly : Microsoft.SharePoint.Portal (dans microsoft.sharepoint.portal.dll)

Syntaxe

'Déclaration
Public Shared Function GetContext ( _
    siteId As Guid, _
    zone As PortalZone _
) As PortalContext
'Utilisation
Dim siteId As Guid
Dim zone As PortalZone
Dim returnValue As PortalContext

returnValue = PortalApplication.GetContext(siteId, zone)
public static PortalContext GetContext (
    Guid siteId,
    PortalZone zone
)

Paramètres

  • siteId
    A globally unique identifier.
  • zone
    A member of the PortalZone enumeration that represents the portal zone.

Valeur de retour

A PortalContext object that represents the current application context.

Remarques

The following table describes the exception types.

Exception Type

Condition

InvalidOperationException

The System.Web.HttpContext.Current static property is null.

Voir aussi

Référence

PortalApplication, classe
Membres PortalApplication
Microsoft.SharePoint.Portal, espace de noms