MvcHttpHandler Class


Verifies and processes an HTTP request.

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

Inheritance Hierarchy



public class MvcHttpHandler : UrlRoutingHandler, IHttpAsyncHandler, 
    IHttpHandler, IRequiresSessionState
public ref class MvcHttpHandler : UrlRoutingHandler, IHttpAsyncHandler, 
    IHttpHandler, IRequiresSessionState
type MvcHttpHandler = 
        inherit UrlRoutingHandler
        interface IHttpAsyncHandler
        interface IHttpHandler
        interface IRequiresSessionState
Public Class MvcHttpHandler
    Inherits UrlRoutingHandler
    Implements IHttpAsyncHandler, IHttpHandler, IRequiresSessionState


Name Description
System_CAPS_pubmethod MvcHttpHandler()

Initializes a new instance of the MvcHttpHandler class.


Name Description
System_CAPS_protproperty IsReusable

(Inherited from UrlRoutingHandler.)

System_CAPS_pubproperty RouteCollection

(Inherited from UrlRoutingHandler.)


Name Description
System_CAPS_protmethod BeginProcessRequest(HttpContext, AsyncCallback, Object)

Called by ASP.NET to begin asynchronous request processing.

System_CAPS_protmethod BeginProcessRequest(HttpContextBase, AsyncCallback, Object)

Called by ASP.NET to begin asynchronous request processing.

System_CAPS_protmethod EndProcessRequest(IAsyncResult)

Called by ASP.NET when asynchronous request processing has ended.

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethod ProcessRequest(HttpContext)

(Inherited from UrlRoutingHandler.)

System_CAPS_protmethod ProcessRequest(HttpContextBase)

(Inherited from UrlRoutingHandler.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_protmethod VerifyAndProcessRequest(IHttpHandler, HttpContextBase)

Verifies and processes an HTTP request.(Overrides UrlRoutingHandler.VerifyAndProcessRequest(IHttpHandler, HttpContextBase).)

Explicit Interface Implementations

Name Description
System_CAPS_pubinterfaceSystem_CAPS_privmethod IHttpAsyncHandler.BeginProcessRequest(HttpContext, AsyncCallback, Object)

Called by ASP.NET to begin asynchronous request processing.

System_CAPS_pubinterfaceSystem_CAPS_privmethod IHttpAsyncHandler.EndProcessRequest(IAsyncResult)

Called by ASP.NET when asynchronous request processing has ended.

System_CAPS_pubinterfaceSystem_CAPS_privmethod IHttpHandler.ProcessRequest(HttpContext)

(Inherited from UrlRoutingHandler.)


MVC includes the following handler types:

  • MvcHandler. This handler is responsible for initiating the ASP.NET pipeline for an MVC application. It receives a Controller instance from the MVC controller factory; this controller handles further processing of the request. Note that even though MvcHandler implements IHttpHandler, it cannot be mapped as a handler (for example, to the .mvc file-name extension) because the class does not support a parameterless constructor. (Its only constructor requires a RequestContext object.)

  • MvcRouteHandler. This class implements IRouteHandler, therefore it can integrate with ASP.NET routing. The MvcRouteHandler class associates the route with an MvcHandler instance. A MvcRouteHandler instance is registered with routing when you use the MapRoute method. When the MvcRouteHandler class is invoked, the class generates an MvcHandler instance using the current RequestContext instance. It then delegates control to the new MvcHandler instance.

  • MvcHttpHandler. This handler is used to facilitate direct handler mapping without going through the routing module. This is useful if you want to map a file-name extension such as .mvc directly to an MVC handler. Internally, MvcHttpHandler performs the same tasks that ASP.NET routing ordinarily performs (going through MvcRouteHandler and MvcHandler). However, it performs these tasks as a handler instead of as a module. This handler is not typically used when the UrlRoutingModule is enabled for all requests.

Thread Safety

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

See Also

System.Web.Mvc Namespace

Return to top