SPContext members

Represents the context of an HTTP request in Microsoft SharePoint Foundation.

The SPContext type exposes the following members.

Properties

  Name Description
Public property ContentTypeSetInQueryString Gets or sets a Boolean value that indicates whether the content type is set in the query string.
Public property ContextPageInfo Gets the information about the current list item for the current request (if there is one). For example, information could include the item ID, if it is a welcome page, or the base permissions of the object.
Public propertyStatic member Current Gets the context of the current HTTP request in Microsoft SharePoint Foundation.
Public property FieldControlCacheGetCallback Gets or sets the delegate to call to check for a cached value in the current Microsoft SharePoint Foundation HTTP context.
Public property FieldControlCacheSetCallback Gets or sets the delegate to call when setting the cached data in the current Microsoft SharePoint Foundation HTTP context.
Public property Fields Gets the fields metadata associated with the item or content type of the Microsoft SharePoint Foundation context.
Public property File Gets the file that is associated with the list item object of the given Microsoft SharePoint Foundation context.
Public property FileLevel Gets the representation of the version of the file or ASP.Net page.
Public property FormContext Gets the form context object for the form-specific Microsoft SharePoint Foundation context.
Public property HasDesignTimeContentType Gets a Boolean value that indicates whether the list item in the current context is associated with a design-time content type.
Public property IsDesignTime Gets a Boolean value that indicates whether the Web request is operating in a design-time configuration.
Public property IsPopUI Gets a value that indicates whether the current request is for a page that represents a pop-up dialog in the user interface (UI).
Public property IsRemoteAuthoringTime Gets a value that represents whether the current request renders for design time.
Public property Item Gets either the SPListItem object that is determined by the given list and item ID, or the SPItem object that is set when the SPContext object is created.
Public property ItemId Gets the ID of the item that is associated with the Microsoft SharePoint Foundation context.
Public property ItemIdAsString Gets or sets a string value for the ID of the list item that is associated with the request context.
Public property List Gets the list that is associated with the Microsoft SharePoint Foundation context.
Public property ListId Gets the GUID of the list that is associated with the Microsoft SharePoint Foundation context.
Public property ListItem Gets the list item associated with the Microsoft SharePoint Foundation context.
Public property ListItemDisplayName Gets or sets the display name for the item that is associated with the current HTTP context of Microsoft SharePoint Foundation.
Public property ListItemServerRelativeUrl Gets or sets the server-relative URL for the list item in the current HTTP context of Microsoft SharePoint Foundation.
Public property ListItemVersion Gets a UInt32 object that represents version number specified by the context.
Public property LoadContentTypes Gets or sets a Boolean value that specifies whether to include content type fields when implementing the Fields property in order to return the fields associated with an item.
Public property MobileContext Gets the mobile context for the Microsoft SharePoint Foundation context.
Public property RecurrenceID Returns the instance ID or exception ID of the Microsoft SharePoint Foundation context, or returns a null reference (Nothing in Visual Basic) if the current context is not associated with an event list item.
Public property RegionalSettings Gets the regional settings object of the current HTTP context in Microsoft SharePoint Foundation.
Public propertyStatic member RenderingFromCurrentMetainfo Gets a value that indicates whether page rendering optimizations are in effect for the current context.
Public property RootFolderUrl Gets the URL of the root folder for the current context.
Public property Site Gets the site collection that is associated with the current Microsoft SharePoint Foundation request context. Used in conjunction with the static Current property.
Public property SiteFeatures Gets the activated site collection features of the Microsoft SharePoint Foundation context.
Public property SiteSubscription Gets the subscription to which this site collection belongs.
Public property UseDefaultCachePolicy Gets or sets a Boolean value that determines whether Microsoft SharePoint Foundation sets the HTTP cache headers on the response for an item fetched from SharePoint Foundation.
Public property ViewContext Gets a view context object that provides information about the current view.
Public property Web Gets the Web site that is associated with the current Microsoft SharePoint Foundation request context. Used in conjunction with the static Current property.
Public property WebFeatures Gets the activated site features of the Microsoft SharePoint Foundation context.

Top

Methods

  Name Description
Public method CacheWeb Caches an SPWeb for the duration of the HTTP request.
Public method ClearCachedWeb Removes a web that has previously been cached for this context.
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetCachedWeb Retrieves a web that was cached for this context.
Public methodStatic member GetContext(HttpContext) Returns the Microsoft SharePoint Foundation context for the specified HTTP context.
Public methodStatic member GetContext(SPWeb) Returns the Microsoft SharePoint Foundation context for the specified Microsoft SharePoint Foundation Web site.
Public methodStatic member GetContext(HttpContext, SPItem, SPWeb) Returns the Microsoft SharePoint Foundation context for an item using the specified HTTP context, item, and Web site.
Public methodStatic member GetContext(HttpContext, Int32, Type) Returns the Microsoft SharePoint Foundation context for an item using the specified HTTP context, item ID, and item type.
Public methodStatic member GetContext(HttpContext, Guid, Guid, SPWeb) Returns the Microsoft SharePoint Foundation context for a view.
Public methodStatic member GetContext(HttpContext, Int32, Guid, SPWeb) Returns the Microsoft SharePoint Foundation context for a list item.
Public methodStatic member GetContext(HttpContext, String, Guid, SPWeb) Returns the Microsoft SharePoint Foundation context for an item using the specified item ID, list ID, and Web site.
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Public method GetValueFromPageData Retrieves a field value from the page data.
Protected method MemberwiseClone (Inherited from Object.)
Public method ResetItem Forces a retrieval of the data that is associated with the SPItem object, even if the data was retrieved earlier.
Public method SetDesignTimeOnContext Set the current context in design rendering mode
Public method ToString (Inherited from Object.)
Public methodStatic member UpdateAfterUrlRewrite Updates the context URI of the alternate URL after doing a URL rewrite.

Top

See also

Reference

SPContext class

Microsoft.SharePoint namespace