This topic has not yet been rated - Rate this topic

MvcHttpHandler Class

Verifies and processes an HTTP request.

System.Object
  System.Web.Routing.UrlRoutingHandler
    System.Web.Mvc.MvcHttpHandler

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)
public class MvcHttpHandler : UrlRoutingHandler, 
	IHttpAsyncHandler, IHttpHandler, IRequiresSessionState

The MvcHttpHandler type exposes the following members.

  Name Description
Public method MvcHttpHandler Initializes a new instance of the MvcHttpHandler class.
Top
  Name Description
Protected property IsReusable (Inherited from UrlRoutingHandler.)
Public property RouteCollection (Inherited from UrlRoutingHandler.)
Top
  Name Description
Protected method BeginProcessRequest(HttpContext, AsyncCallback, Object) Called by ASP.NET to begin asynchronous request processing.
Protected method BeginProcessRequest(HttpContextBase, AsyncCallback, Object) Called by ASP.NET to begin asynchronous request processing.
Protected method EndProcessRequest Called by ASP.NET when asynchronous request processing has ended.
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Protected method ProcessRequest(HttpContext) (Inherited from UrlRoutingHandler.)
Protected method ProcessRequest(HttpContextBase) (Inherited from UrlRoutingHandler.)
Public method ToString (Inherited from Object.)
Protected method VerifyAndProcessRequest Verifies and processes an HTTP request. (Overrides UrlRoutingHandler.VerifyAndProcessRequest(IHttpHandler, HttpContextBase).)
Top
  Name Description
Explicit interface implemetation Private method IHttpAsyncHandler.BeginProcessRequest Called by ASP.NET to begin asynchronous request processing.
Explicit interface implemetation Private method IHttpAsyncHandler.EndProcessRequest Called by ASP.NET when asynchronous request processing has ended.
Explicit interface implemetation Private property IHttpHandler.IsReusable (Inherited from UrlRoutingHandler.)
Explicit interface implemetation Private method IHttpHandler.ProcessRequest (Inherited from UrlRoutingHandler.)
Top

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)