Represents the current state for this request.
For a list of all members of this type, see Context Members.
System.Object
Sitecore.Context
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
The Context object holds information about the current state such as current database, current language, current domain etc.
Many of these properties are resolved in the HttpRequest pipeline which runs on every request. The pipeline resolves the current site and sets many of the properties on the Context object from this site, e.g. database, current item and language.
The following example gets the Home item in the current database
{{
public void Item GetHome() {
return Sitecore.Context.Database.Items["/sitecore/content/Home"];
}
}}
Namespace: Sitecore
Assembly: Sitecore.Kernel (in Sitecore.Kernel.dll)
Context Members | Sitecore Namespace