HttpContextWrapper HttpContextWrapper HttpContextWrapper HttpContextWrapper Class

Definition

Encapsulates the HTTP intrinsic object that contains HTTP-specific information about an individual HTTP request.

public ref class HttpContextWrapper : System::Web::HttpContextBase
public class HttpContextWrapper : System.Web.HttpContextBase
type HttpContextWrapper = class
    inherit HttpContextBase
Public Class HttpContextWrapper
Inherits HttpContextBase
Inheritance
HttpContextWrapperHttpContextWrapperHttpContextWrapperHttpContextWrapper

Remarks

The HttpContextWrapper class derives from the HttpContextBase class and serves as a wrapper for the HttpContext class. This class exposes the functionality of the HttpContext class and also exposes the HttpContextBase type. The HttpContextBase class lets you replace the original implementation of the HttpContext class in your application with a custom implementation, such as when you perform unit testing outside the ASP.NET pipeline.

Constructors

HttpContextWrapper(HttpContext) HttpContextWrapper(HttpContext) HttpContextWrapper(HttpContext) HttpContextWrapper(HttpContext)

Initializes a new instance of the HttpContextWrapper class by using the specified context object.

Properties

AllErrors AllErrors AllErrors AllErrors

Gets an array of errors (if any) that accumulated when an HTTP request was being processed.

AllowAsyncDuringSyncStages AllowAsyncDuringSyncStages AllowAsyncDuringSyncStages AllowAsyncDuringSyncStages

Gets or sets a value that indicates whether asynchronous operations are allowed during parts of ASP.NET request processing when they are not expected.

Application Application Application Application

Gets the HttpApplicationState object for the current HTTP request.

ApplicationInstance ApplicationInstance ApplicationInstance ApplicationInstance

Gets or sets the HttpApplication object for the current HTTP request.

AsyncPreloadMode AsyncPreloadMode AsyncPreloadMode AsyncPreloadMode

Gets or sets an object that contains flags that pertain to asynchronous preload mode.

Cache Cache Cache Cache

Gets the Cache object for the current application domain.

CurrentHandler CurrentHandler CurrentHandler CurrentHandler

Gets the IHttpHandler object that represents the handler that is currently executing.

CurrentNotification CurrentNotification CurrentNotification CurrentNotification

Gets a RequestNotification value that indicates the current HttpApplication event that is processing.

Error Error Error Error

Gets the first error (if any) that accumulated when an HTTP request was being processed.

Handler Handler Handler Handler

Gets or sets the IHttpHandler object that is responsible for processing the HTTP request.

IsCustomErrorEnabled IsCustomErrorEnabled IsCustomErrorEnabled IsCustomErrorEnabled

Gets a value that indicates whether custom errors are enabled for the current HTTP request.

IsDebuggingEnabled IsDebuggingEnabled IsDebuggingEnabled IsDebuggingEnabled

Gets a value that indicates whether the current HTTP request is in debug mode.

IsPostNotification IsPostNotification IsPostNotification IsPostNotification

Gets a value that indicates whether an HttpApplication event has finished processing.

IsWebSocketRequest IsWebSocketRequest IsWebSocketRequest IsWebSocketRequest

Gets a value that indicates whether the request is an AspNetWebSocket request.

IsWebSocketRequestUpgrading IsWebSocketRequestUpgrading IsWebSocketRequestUpgrading IsWebSocketRequestUpgrading

Gets a value that indicates whether the connection is upgrading from an HTTP connection to an AspNetWebSocket connection.

Items Items Items Items

Gets a key/value collection that can be used to organize and share data between a module and a handler during an HTTP request.

PageInstrumentation PageInstrumentation PageInstrumentation PageInstrumentation

Gets a reference to the page-instrumentation service instance for this request.

PreviousHandler PreviousHandler PreviousHandler PreviousHandler

Gets the IHttpHandler object for the parent handler.

Profile Profile Profile Profile

Gets the ProfileBase object for the current user profile.

Request Request Request Request

Gets the HttpRequestBase object for the current HTTP request.

Response Response Response Response

Gets the HttpResponseBase object for the current HTTP response.

Server Server Server Server

Gets the HttpServerUtilityBase object that provides methods that are used when Web requests are being processed.

Session Session Session Session

Gets the HttpSessionStateBase object for the current HTTP request.

SkipAuthorization SkipAuthorization SkipAuthorization SkipAuthorization

Gets or sets a value that specifies whether the UrlAuthorizationModule object should skip the authorization check for the current request.

ThreadAbortOnTimeout ThreadAbortOnTimeout ThreadAbortOnTimeout ThreadAbortOnTimeout

Gets or sets a value that specifies whether the ASP.NET runtime should call Abort() on the thread that is servicing this request when the request times out.

Timestamp Timestamp Timestamp Timestamp

Gets the initial timestamp of the current HTTP request.

Trace Trace Trace Trace

Gets the TraceContext object for the current HTTP response.

User User User User

Gets or sets security information for the current HTTP request.

WebSocketNegotiatedProtocol WebSocketNegotiatedProtocol WebSocketNegotiatedProtocol WebSocketNegotiatedProtocol

Gets the negotiated protocol that was sent from the server to the client for an AspNetWebSocket request.

WebSocketRequestedProtocols WebSocketRequestedProtocols WebSocketRequestedProtocols WebSocketRequestedProtocols

Gets the ordered list of protocols requested by the client.

Methods

AcceptWebSocketRequest(Func<AspNetWebSocketContext,Task>) AcceptWebSocketRequest(Func<AspNetWebSocketContext,Task>) AcceptWebSocketRequest(Func<AspNetWebSocketContext,Task>) AcceptWebSocketRequest(Func<AspNetWebSocketContext,Task>)

Accepts an AspNetWebSocket request using the specified user function.

AcceptWebSocketRequest(Func<AspNetWebSocketContext,Task>, AspNetWebSocketOptions) AcceptWebSocketRequest(Func<AspNetWebSocketContext,Task>, AspNetWebSocketOptions) AcceptWebSocketRequest(Func<AspNetWebSocketContext,Task>, AspNetWebSocketOptions) AcceptWebSocketRequest(Func<AspNetWebSocketContext,Task>, AspNetWebSocketOptions)

Accepts an AspNetWebSocket request using the specified user function and options object.

AddError(Exception) AddError(Exception) AddError(Exception) AddError(Exception)

Adds an exception to the exception collection for the current HTTP request.

AddOnRequestCompleted(Action<HttpContextBase>) AddOnRequestCompleted(Action<HttpContextBase>) AddOnRequestCompleted(Action<HttpContextBase>) AddOnRequestCompleted(Action<HttpContextBase>)

Raises a virtual event that occurs when the HTTP part of the request is ending.

ClearError() ClearError() ClearError() ClearError()

Clears all errors for the current HTTP request.

DisposeOnPipelineCompleted(IDisposable) DisposeOnPipelineCompleted(IDisposable) DisposeOnPipelineCompleted(IDisposable) DisposeOnPipelineCompleted(IDisposable)

Enables an object's Dispose() method to be called when the AspNetWebSocket connection part of this request is completed.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetGlobalResourceObject(String, String) GetGlobalResourceObject(String, String) GetGlobalResourceObject(String, String) GetGlobalResourceObject(String, String)

Gets an application-level resource object based on the specified ClassKey and ResourceKey properties.

GetGlobalResourceObject(String, String, CultureInfo) GetGlobalResourceObject(String, String, CultureInfo) GetGlobalResourceObject(String, String, CultureInfo) GetGlobalResourceObject(String, String, CultureInfo)

Gets an application-level resource object based on the specified ClassKey and ResourceKey properties, and on the CultureInfo object.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetLocalResourceObject(String, String) GetLocalResourceObject(String, String) GetLocalResourceObject(String, String) GetLocalResourceObject(String, String)

Gets a page-level resource object based on the specified VirtualPath and ResourceKey properties.

GetLocalResourceObject(String, String, CultureInfo) GetLocalResourceObject(String, String, CultureInfo) GetLocalResourceObject(String, String, CultureInfo) GetLocalResourceObject(String, String, CultureInfo)

Gets a page-level resource object based on the specified VirtualPath and ResourceKey properties, and on the CultureInfo object.

GetSection(String) GetSection(String) GetSection(String) GetSection(String)

Gets the specified configuration section of the current application's default configuration.

GetService(Type) GetService(Type) GetService(Type) GetService(Type)

Returns an object for the current service type.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
RemapHandler(IHttpHandler) RemapHandler(IHttpHandler) RemapHandler(IHttpHandler) RemapHandler(IHttpHandler)

Enables you to specify a handler for the request.

RewritePath(String) RewritePath(String) RewritePath(String) RewritePath(String)

Rewrites the URL by using the specified path.

RewritePath(String, Boolean) RewritePath(String, Boolean) RewritePath(String, Boolean) RewritePath(String, Boolean)

Rewrites the URL by using the specified path and a value that specifies whether the virtual path for server resources is modified.

RewritePath(String, String, String) RewritePath(String, String, String) RewritePath(String, String, String) RewritePath(String, String, String)

Rewrites the URL by using the specified path, path information, and query string information.

RewritePath(String, String, String, Boolean) RewritePath(String, String, String, Boolean) RewritePath(String, String, String, Boolean) RewritePath(String, String, String, Boolean)

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.

SetSessionStateBehavior(SessionStateBehavior) SetSessionStateBehavior(SessionStateBehavior) SetSessionStateBehavior(SessionStateBehavior) SetSessionStateBehavior(SessionStateBehavior)

Sets the type of session state behavior that is required in order to support an HTTP request.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to