HttpContextWrapper Class

 

Encapsulates the HTTP intrinsic object that contains 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 class HttpContextWrapper : HttpContextBase

NameDescription
System_CAPS_pubmethodHttpContextWrapper(HttpContext)

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

NameDescription
System_CAPS_pubpropertyAllErrors

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

System_CAPS_pubpropertyAllowAsyncDuringSyncStages

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

System_CAPS_pubpropertyApplication

Gets the HttpApplicationState object for the current HTTP request.(Overrides HttpContextBase.Application.)

System_CAPS_pubpropertyApplicationInstance

Gets or sets the HttpApplication object for the current HTTP request.(Overrides HttpContextBase.ApplicationInstance.)

System_CAPS_pubpropertyAsyncPreloadMode

Gets or sets an object that contains flags that pertain to asynchronous preload mode.(Overrides HttpContextBase.AsyncPreloadMode.)

System_CAPS_pubpropertyCache

Gets the Cache object for the current application domain.(Overrides HttpContextBase.Cache.)

System_CAPS_pubpropertyCurrentHandler

Gets the IHttpHandler object that represents the handler that is currently executing.(Overrides HttpContextBase.CurrentHandler.)

System_CAPS_pubpropertyCurrentNotification

Gets a RequestNotification value that indicates the current HttpApplication event that is processing.(Overrides HttpContextBase.CurrentNotification.)

System_CAPS_pubpropertyError

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

System_CAPS_pubpropertyHandler

Gets or sets the IHttpHandler object that is responsible for processing the HTTP request.(Overrides HttpContextBase.Handler.)

System_CAPS_pubpropertyIsCustomErrorEnabled

Gets a value that indicates whether custom errors are enabled for the current HTTP request.(Overrides HttpContextBase.IsCustomErrorEnabled.)

System_CAPS_pubpropertyIsDebuggingEnabled

Gets a value that indicates whether the current HTTP request is in debug mode.(Overrides HttpContextBase.IsDebuggingEnabled.)

System_CAPS_pubpropertyIsPostNotification

Gets a value that indicates whether an HttpApplication event has finished processing.(Overrides HttpContextBase.IsPostNotification.)

System_CAPS_pubpropertyIsWebSocketRequest

Gets a value that indicates whether the request is an AspNetWebSocket request.(Overrides HttpContextBase.IsWebSocketRequest.)

System_CAPS_pubpropertyIsWebSocketRequestUpgrading

Gets a value that indicates whether the connection is upgrading from an HTTP connection to an AspNetWebSocket connection.(Overrides HttpContextBase.IsWebSocketRequestUpgrading.)

System_CAPS_pubpropertyItems

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

System_CAPS_pubpropertyPageInstrumentation

Gets a reference to the page-instrumentation service instance for this request.(Overrides HttpContextBase.PageInstrumentation.)

System_CAPS_pubpropertyPreviousHandler

Gets the IHttpHandler object for the parent handler.(Overrides HttpContextBase.PreviousHandler.)

System_CAPS_pubpropertyProfile

Gets the ProfileBase object for the current user profile.(Overrides HttpContextBase.Profile.)

System_CAPS_pubpropertyRequest

Gets the HttpRequestBase object for the current HTTP request.(Overrides HttpContextBase.Request.)

System_CAPS_pubpropertyResponse

Gets the HttpResponseBase object for the current HTTP response.(Overrides HttpContextBase.Response.)

System_CAPS_pubpropertyServer

Gets the HttpServerUtilityBase object that provides methods that are used when Web requests are being processed.(Overrides HttpContextBase.Server.)

System_CAPS_pubpropertySession

Gets the HttpSessionStateBase object for the current HTTP request.(Overrides HttpContextBase.Session.)

System_CAPS_pubpropertySkipAuthorization

Gets or sets a value that specifies whether the UrlAuthorizationModule object should skip the authorization check for the current request.(Overrides HttpContextBase.SkipAuthorization.)

System_CAPS_pubpropertyThreadAbortOnTimeout

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.(Overrides HttpContextBase.ThreadAbortOnTimeout.)

System_CAPS_pubpropertyTimestamp

Gets the initial timestamp of the current HTTP request.(Overrides HttpContextBase.Timestamp.)

System_CAPS_pubpropertyTrace

Gets the TraceContext object for the current HTTP response.(Overrides HttpContextBase.Trace.)

System_CAPS_pubpropertyUser

Gets or sets security information for the current HTTP request.(Overrides HttpContextBase.User.)

System_CAPS_pubpropertyWebSocketNegotiatedProtocol

Gets the negotiated protocol that was sent from the server to the client for an AspNetWebSocket request.(Overrides HttpContextBase.WebSocketNegotiatedProtocol.)

System_CAPS_pubpropertyWebSocketRequestedProtocols

Gets the ordered list of protocols requested by the client.(Overrides HttpContextBase.WebSocketRequestedProtocols.)

NameDescription
System_CAPS_pubmethodAcceptWebSocketRequest(Func<AspNetWebSocketContext, Task>)

Accepts an AspNetWebSocket request using the specified user function.(Overrides HttpContextBase.AcceptWebSocketRequest(Func<AspNetWebSocketContext, Task>).)

System_CAPS_pubmethodAcceptWebSocketRequest(Func<AspNetWebSocketContext, Task>, AspNetWebSocketOptions)

Accepts an AspNetWebSocket request using the specified user function and options object.(Overrides HttpContextBase.AcceptWebSocketRequest(Func<AspNetWebSocketContext, Task>, AspNetWebSocketOptions).)

System_CAPS_pubmethodAddError(Exception)

Adds an exception to the exception collection for the current HTTP request.(Overrides HttpContextBase.AddError(Exception).)

System_CAPS_pubmethodAddOnRequestCompleted(Action<HttpContextBase>)

Raises a virtual event that occurs when the HTTP part of the request is ending.(Overrides HttpContextBase.AddOnRequestCompleted(Action<HttpContextBase>).)

System_CAPS_pubmethodClearError()

Clears all errors for the current HTTP request.(Overrides HttpContextBase.ClearError().)

System_CAPS_pubmethodDisposeOnPipelineCompleted(IDisposable)

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

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)

Gets an application-level resource object based on the specified ClassKey and ResourceKey properties.(Overrides HttpContextBase.GetGlobalResourceObject(String, String).)

System_CAPS_pubmethodGetGlobalResourceObject(String, String, CultureInfo)

Gets an application-level resource object based on the specified ClassKey and ResourceKey properties, and on the CultureInfo object.(Overrides HttpContextBase.GetGlobalResourceObject(String, String, CultureInfo).)

System_CAPS_pubmethodGetHashCode()

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

System_CAPS_pubmethodGetLocalResourceObject(String, String)

Gets a page-level resource object based on the specified VirtualPath and ResourceKey properties.(Overrides HttpContextBase.GetLocalResourceObject(String, String).)

System_CAPS_pubmethodGetLocalResourceObject(String, String, CultureInfo)

Gets a page-level resource object based on the specified VirtualPath and ResourceKey properties, and on the CultureInfo object.(Overrides HttpContextBase.GetLocalResourceObject(String, String, CultureInfo).)

System_CAPS_pubmethodGetSection(String)

Gets the specified configuration section of the current application's default configuration.(Overrides HttpContextBase.GetSection(String).)

System_CAPS_pubmethodGetService(Type)

Returns an object for the current service type.(Overrides HttpContextBase.GetService(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)

Enables you to specify a handler for the request.(Overrides HttpContextBase.RemapHandler(IHttpHandler).)

System_CAPS_pubmethodRewritePath(String)

Rewrites the URL by using the specified path.(Overrides HttpContextBase.RewritePath(String).)

System_CAPS_pubmethodRewritePath(String, Boolean)

Rewrites the URL by using the specified path and a value that specifies whether the virtual path for server resources is modified.(Overrides HttpContextBase.RewritePath(String, Boolean).)

System_CAPS_pubmethodRewritePath(String, String, String)

Rewrites the URL by using the specified path, path information, and query string information.(Overrides HttpContextBase.RewritePath(String, String, String).)

System_CAPS_pubmethodRewritePath(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.(Overrides HttpContextBase.RewritePath(String, String, String, Boolean).)

System_CAPS_pubmethodSetSessionStateBehavior(SessionStateBehavior)

Sets the type of session state behavior that is required in order to support an HTTP request.(Overrides HttpContextBase.SetSessionStateBehavior(SessionStateBehavior).)

System_CAPS_pubmethodToString()

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

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.

.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: