HttpContext::Current Property
Gets or sets the HttpContext object for the current HTTP request.
Assembly: System.Web (in System.Web.dll)
public: property HttpContext^ Current { static HttpContext^ get(); static void set(HttpContext^ value); }
This property is a static property of the HttpContext class. The property stores the HttpContext instance that applies to the current request. The properties of this instance are the non-static properties of the HttpContext class.
You can also use the Page::Context property to access the HttpContext object for the current HTTP request.
The following code example uses the Current property to access the HttpContext::AddError and HttpContext::ClearError methods and the HttpContext::AllErrors property. The example creates three custom exceptions using the AddError method and uses the AllErrors property to load these exceptions to an array. It then writes the array to the containing page and uses the ClearError method to clear all the errors from the Context property.
Available since 1.1