System.Web.HttpContext.Current Property

Gets or sets the System.Web.HttpContext object for the current HTTP request.

Syntax

public static HttpContext Current { set; get; }

Value

This property is a gross hack. It is used by applications that have not passed the System.Web.HttpContext class around and require access to it.

The routine internally uses a technique similar to thread local storage to fetch the value which is slower than having this property available as a parameter to your routines.

Remarks

This property is a static property of the System.Web.HttpContext class. The property stores the System.Web.HttpContext instance that applies to the current request. The properties of this instance are the non-static properties of the System.Web.HttpContext class.

You can also use the System.Web.UI.Page.Context property to access the System.Web.HttpContext object for the current HTTP request.

Requirements

Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0