SPServiceContext.GetContext Method (HttpContext)
Gets the service context that is associated with the specified HttpContext object.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Shared Function GetContext ( _
httpContext As HttpContext _
) As SPServiceContext
'Usage
Dim httpContext As HttpContext
Dim returnValue As SPServiceContext
returnValue = SPServiceContext.GetContext(httpContext)
public static SPServiceContext GetContext(
HttpContext httpContext
)
Parameters
httpContext
Type: System.Web.HttpContextThe HttpContext object for which to retrieve the service context.
Return Value
Type: Microsoft.SharePoint.SPServiceContext
The SPServiceContext object that is associated with the specified HttpContext object.