From the course: ASP.NET MVC: HTTP Request Life Cycle

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Understand route handlers

Understand route handlers

From the course: ASP.NET MVC: HTTP Request Life Cycle

Start my 1-month free trial

Understand route handlers

- [Instructor] When the URL routing module maps a request to a route, it obtains the appropriate route handler. This is an object that implements the IRouteHandler interface. In an MVC application, that object is the MVC route handler. This class gets registered when you use the map route method to define routes. The MVC route handler instance then creates and MVC handler in the GetHttpHandler method. MVC handler implements IHttpHandler and exposes the interface methods like process request. This handler is important because it's responsible for starting the pipeline for an ASP.NET MVC application. It's the entry point into the MVC framework. MVC handler then initializes and executes the controller that will handle the request. Let's look at a snippet of the MVC route handler source code. Here's the GetHttpHandler implementation. The MVC handler is instantiated using the current request context. MVC route handler is the default built-in route handler but you can override it if you…

Contents