HttpContextBase Class
TOC
Collapse the table of content
Expand the table of content

HttpContextBase Class

.NET Framework (current version)
 

Serves as the base class for classes that contain HTTP-specific information about an individual HTTP request.

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

System.Object
  System.Web.HttpContextBase
    System.Web.HttpContextWrapper

public abstract class HttpContextBase : IServiceProvider

NameDescription
System_CAPS_protmethodHttpContextBase()

Initializes the class for use by an inherited class instance. This constructor can only be called by an inherited class.

NameDescription
System_CAPS_pubpropertyAllErrors

When overridden in a derived class, gets an array of errors (if any) that accumulated when an HTTP request was being processed.

System_CAPS_pubpropertyAllowAsyncDuringSyncStages

When implemented in a derived class, gets or sets a value that indicates whether asynchronous operations are allowed during parts of ASP.NET request processing when they are not expected.

System_CAPS_pubpropertyApplication

When overridden in a derived class, gets the HttpApplicationState object for the current HTTP request.

System_CAPS_pubpropertyApplicationInstance

When overridden in a derived class, gets or sets the HttpApplication object for the current HTTP request.

System_CAPS_pubpropertyAsyncPreloadMode

When implemented in a derived class, gets or sets an object that contains flags that pertain to asynchronous preload mode.

System_CAPS_pubpropertyCache

When overridden in a derived class, gets the Cache object for the current application domain.

System_CAPS_pubpropertyCurrentHandler

When overridden in a derived class, gets the IHttpHandler object that represents the handler that is currently executing.

System_CAPS_pubpropertyCurrentNotification

When overridden in a derived class, gets a RequestNotification value that indicates the HttpApplication event that is currently processing.

System_CAPS_pubpropertyError

When overridden in a derived class, gets the first error (if any) that accumulated when an HTTP request was being processed.

System_CAPS_pubpropertyHandler

When overridden in a derived class, gets or sets the IHttpHandler object that is responsible for processing the HTTP request.

System_CAPS_pubpropertyIsCustomErrorEnabled

When overridden in a derived class, gets a value that indicates whether custom errors are enabled for the current HTTP request.

System_CAPS_pubpropertyIsDebuggingEnabled

When overridden in a derived class, gets a value that indicates whether the current HTTP request is in debug mode.

System_CAPS_pubpropertyIsPostNotification

When overridden in a derived class, gets a value that indicates whether an HttpApplication event has finished processing.

System_CAPS_pubpropertyIsWebSocketRequest

When implemented in a derived class, gets a value that indicates whether the request is an AspNetWebSocket connection request.

System_CAPS_pubpropertyIsWebSocketRequestUpgrading

When implemented in a derived class, gets a value that indicates whether the connection is upgrading from an HTTP connection to an AspNetWebSocket connection.

System_CAPS_pubpropertyItems

When overridden in a derived class, gets a key/value collection that can be used to organize and share data between a module and a handler during an HTTP request.

System_CAPS_pubpropertyPageInstrumentation

When implemented in a derived class, gets a reference to the page-instrumentation service instance for this request.

System_CAPS_pubpropertyPreviousHandler

When overridden in a derived class, gets the IHttpHandler object for the parent handler.

System_CAPS_pubpropertyProfile

When overridden in a derived class, gets the ProfileBase object for the current user profile.

System_CAPS_pubpropertyRequest

When overridden in a derived class, gets the HttpRequest object for the current HTTP request.

System_CAPS_pubpropertyResponse

When overridden in a derived class, gets the HttpResponse object for the current HTTP response.

System_CAPS_pubpropertyServer

When overridden in a derived class, gets the HttpServerUtility object that provides methods that are used when Web requests are being processed.

System_CAPS_pubpropertySession

When overridden in a derived class, gets the HttpSessionState object for the current HTTP request.

System_CAPS_pubpropertySkipAuthorization

When overridden in a derived class, gets or sets a value that specifies whether the UrlAuthorizationModule object should skip the authorization check for the current request.

System_CAPS_pubpropertyThreadAbortOnTimeout

When implemented in a derived class, gets or sets a value that specifies whether the ASP.NET runtime should call Thread.Abort on the thread that is servicing this request when the request times out.

System_CAPS_pubpropertyTimestamp

When overridden in a derived class, gets the initial timestamp of the current HTTP request.

System_CAPS_pubpropertyTrace

When overridden in a derived class, gets the TraceContext object for the current HTTP response.

System_CAPS_pubpropertyUser

When overridden in a derived class, gets or sets security information for the current HTTP request.

System_CAPS_pubpropertyWebSocketNegotiatedProtocol

When implemented in a derived class, gets the negotiated protocol that was sent from the server to the client for an AspNetWebSocket connection.

System_CAPS_pubpropertyWebSocketRequestedProtocols

When implemented in a derived class, gets the ordered list of protocols that were requested by the client.

NameDescription
System_CAPS_pubmethodAcceptWebSocketRequest(Func<AspNetWebSocketContext, Task>)

When implemented in a derived class, accepts an AspNetWebSocket request using the specified user function.

System_CAPS_pubmethodAcceptWebSocketRequest(Func<AspNetWebSocketContext, Task>, AspNetWebSocketOptions)

When implemented in a derived class, accepts an AspNetWebSocket request using the specified user function and options object.

System_CAPS_pubmethodAddError(Exception)

When overridden in a derived class, adds an exception to the exception collection for the current HTTP request.

System_CAPS_pubmethodAddOnRequestCompleted(Action<HttpContextBase>)

When implemented in a derived class, raises a virtual event that occurs when the HTTP part of the request is ending.

System_CAPS_pubmethodClearError()

When overridden in a derived class, clears all errors for the current HTTP request.

System_CAPS_pubmethodDisposeOnPipelineCompleted(IDisposable)

When implemented in a derived class, enables an object's Dispose method to be called when the AspNetWebSocket connection part of this request is completed.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetGlobalResourceObject(String, String)

When overridden in a derived class, gets an application-level resource object based on the specified ClassKey and ResourceKey properties.

System_CAPS_pubmethodGetGlobalResourceObject(String, String, CultureInfo)

When overridden in a derived class, gets an application-level resource object based on the specified ClassKey and ResourceKey properties, and on the CultureInfo object.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetLocalResourceObject(String, String)

When overridden in a derived class, gets a page-level resource object based on the specified VirtualPath and ResourceKey properties.

System_CAPS_pubmethodGetLocalResourceObject(String, String, CultureInfo)

When overridden in a derived class, gets a page-level resource object based on the specified VirtualPath and ResourceKey properties, and on the CultureInfo object.

System_CAPS_pubmethodGetSection(String)

When overridden in a derived class, gets the specified configuration section of the current application's default configuration.

System_CAPS_pubmethodGetService(Type)

When overridden in a derived class, returns an object for the current service type.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodRemapHandler(IHttpHandler)

When overridden in a derived class, specifies a handler for the request.

System_CAPS_pubmethodRewritePath(String)

When overridden in a derived class, rewrites the URL by using the specified path.

System_CAPS_pubmethodRewritePath(String, Boolean)

When overridden in a derived class, rewrites the URL by using the specified path and a value that specifies whether the virtual path for server resources is modified.

System_CAPS_pubmethodRewritePath(String, String, String)

When overridden in a derived class, rewrites the URL by using the specified path, path information, and query string information.

System_CAPS_pubmethodRewritePath(String, String, String, Boolean)

When overridden in a derived class, rewrites the URL by using the specified path, path information, query string information, and a value that specifies whether the client file path is set to the rewrite path.

System_CAPS_pubmethodSetSessionStateBehavior(SessionStateBehavior)

When overridden in a derived class, sets the type of session state behavior that is required to support an HTTP request.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

The HttpContextBase class is an abstract class that contains the same members as the HttpContext class. The HttpContextBase class enables you to create derived classes that are like the HttpContext class, but that you can customize and that work outside the ASP.NET pipeline. When you perform unit testing, you typically use a derived class to implement members with customized behavior that fulfills the scenario you are testing.

The HttpContextWrapper class derives from the HttpContextBase class. The HttpContextWrapper class serves as a wrapper for the HttpContext class. At run time, you typically use an instance of the HttpContextWrapper class to call members on the HttpContext object.

.NET Framework
Available since 3.5

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft