SPContext.GetContext method (HttpContext)

Returns the Microsoft SharePoint Foundation context for the specified HTTP context.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)


Public Shared Function GetContext ( _
    context As HttpContext _
) As SPContext
Dim context As HttpContext
Dim returnValue As SPContext

returnValue = SPContext.GetContext(context)
public static SPContext GetContext(
    HttpContext context


  • context
    Type: System.Web.HttpContext

    A System.Web.HTTPContext object that encapsulates the HTTP-specific context that is used by the server to process site requests.

Return value

Type: Microsoft.SharePoint.SPContext
The SharePoint Foundation context.

See also


SPContext class

SPContext members

GetContext overload

Microsoft.SharePoint namespace