SPContext.GetContext 方法 (HttpContext, Int32, Type)

返回使用指定的 HTTP 上下文、 项 ID 和项类型的项的Microsoft SharePoint Foundation上下文。

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Shared Function GetContext ( _
    context As HttpContext, _
    itemId As Integer, _
    itemType As Type _
) As SPContext
用法
Dim context As HttpContext
Dim itemId As Integer
Dim itemType As Type
Dim returnValue As SPContext

returnValue = SPContext.GetContext(context, _
    itemId, itemType)
public static SPContext GetContext(
    HttpContext context,
    int itemId,
    Type itemType
)

参数

  • context
    类型:System.Web.HttpContext

    System.Web.HTTPContext对象,该对象封装服务器用于处理网站请求的 HTTP 特定上下文。

  • itemId
    类型:System.Int32

    一个 32 位整数,标识的项。

  • itemType
    类型:System.Type

    System.Type表示的项的类型。

返回值

类型:Microsoft.SharePoint.SPContext
SharePoint Foundation上下文中。

另请参阅

引用

SPContext 类

SPContext 成员

GetContext 重载

Microsoft.SharePoint 命名空间