Condividi tramite


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)
Available in Sandboxed Solutions: No
Available in SharePoint Online

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