Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

MvcHandler Class

 

Selects the controller that will handle an HTTP request.

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

System.Object
  System.Web.Mvc.MvcHandler

No code example is currently available or this language may not be supported.

NameDescription
System_CAPS_pubmethodMvcHandler(RequestContext)

Initializes a new instance of the MvcHandler class.

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticDisableMvcResponseHeader

Gets or sets a value that indicates whether the MVC response header is disabled.

System_CAPS_protpropertyIsReusable

Gets a value that indicates whether another request can use the IHttpHandler instance.

System_CAPS_pubpropertyRequestContext

Gets the request context.

NameDescription
System_CAPS_protmethodAddVersionHeader(HttpContextBase)

Adds the version header by using the specified HTTP context.

System_CAPS_protmethodBeginProcessRequest(HttpContext, AsyncCallback, Object)

Called by ASP.NET to begin asynchronous request processing.

System_CAPS_protmethodBeginProcessRequest(HttpContextBase, AsyncCallback, Object)

Called by ASP.NET to begin asynchronous request processing using the base HTTP context.

System_CAPS_protmethodEndProcessRequest(IAsyncResult)

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

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethodProcessRequest(HttpContext)

Processes the request by using the specified HTTP request context.

System_CAPS_protmethodProcessRequest(HttpContextBase)

Processes the request by using the specified base HTTP request context.

System_CAPS_pubmethodToString()

(Inherited from Object.)

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticMvcVersionHeaderName

Contains the header name of the ASP.NET MVC version.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIHttpAsyncHandler.BeginProcessRequest(HttpContext, AsyncCallback, Object)

Called by ASP.NET to begin asynchronous request processing using the base HTTP context.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIHttpAsyncHandler.EndProcessRequest(IAsyncResult)

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

System_CAPS_pubinterfaceSystem_CAPS_privmethodIHttpHandler.ProcessRequest(HttpContext)

Enables processing of HTTP Web requests by a custom HTTP handler that implements the IHttpHandler interface.

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.

Return to top
Show:
© 2015 Microsoft