Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Page::Context Property

 

Gets the HttpContext object associated with the page.

Namespace:   System.Web.UI
Assembly:  System.Web (in System.Web.dll)

public protected:
property HttpContext^ Context {
	virtual HttpContext^ get() override;
}

Property Value

Type: System.Web::HttpContext^

An HttpContext object that contains information associated with the current page.

This property provides programmatic access to the context the page runs in, including information about the request, response, session, and application.

The following code example uses the Context 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.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft