SPContext.GetContext method (HttpContext, String, Guid, SPWeb)

Returns the Microsoft SharePoint Foundation context for an item using the specified item ID, list ID, and Web site.

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

Syntax

'Declaration
Public Shared Function GetContext ( _
    context As HttpContext, _
    itemId As String, _
    listId As Guid, _
    web As SPWeb _
) As SPContext
'Usage
Dim context As HttpContext
Dim itemId As String
Dim listId As Guid
Dim web As SPWeb
Dim returnValue As SPContext

returnValue = SPContext.GetContext(context, _
    itemId, listId, web)
public static SPContext GetContext(
    HttpContext context,
    string itemId,
    Guid listId,
    SPWeb web
)

Parameters

  • itemId
    Type: System.String

    A 32-bit integer that identifies the item.

  • listId
    Type: System.Guid

    A System.Guid that identifies the list.

Return value

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

See also

Reference

SPContext class

SPContext members

GetContext overload

Microsoft.SharePoint namespace