返回使用指定的 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.HttpContextSystem.Web.HTTPContext对象,该对象封装服务器用于处理网站请求的 HTTP 特定上下文。
itemId
类型:System.Int32一个 32 位整数,标识的项。
itemType
类型:System.TypeSystem.Type表示的项的类型。
返回值
类型:Microsoft.SharePoint.SPContext
SharePoint Foundation上下文中。