---
title: "How route table is created in ASP.NET MVC4?"  
description: "How route table is created in ASP.NET MVC4?"  
author: "Vijay Shukla"  
published: 2012-12-07  
updated: 2020-09-24  
canonical: https://www.mindstick.com/interview/1590/how-route-table-is-created-in-asp-dot-net-mvc4  
category: "asp.net mvc"  
tags: ["asp.net mvc"]  
reading_time: 1 minute  

---

# How route table is created in ASP.NET MVC4?

When an MVC4 application starts, the Application_Start() method is called. This method is calls the RegisterRoutes() method. Which is creates the route table.

## Answers

### Answer by Abhishek Singh

you need to register Routes in the Application_Start() method like this\
protected void Application_Start(){ RouteConfig.RegisterRoutes(RouteTable.Routes);}\
After that you need to override the method of RouteConfig Class like this public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); //routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Blog", url: "Blog/{id}/{Title}", defaults: new { controller = "Blog", action = "Index", id = UrlParameter.Optional });\
// routes.MapRoute( name: "DeveloperSection", url: "DeveloperSection.aspx/{id}", defaults: new { controller = "Developer", action = "Index", id = UrlParameter.Optional });\
\
routes.MapRoute( name: "Articles", url: "Articless/{article_id}", //url: "{controller}/{article_id}", defaults: new { controller = "Articles", action = "Index", article_id = UrlParameter.Optional }); // used for blog URL\
// routes.MapRoute( name: "Default", url: "{controller}/{action}", defaults: new { controller = "Home", action = "Index" });\
\
}\
\
From this you need URL Routing in MVC 4

### Answer by Vijay Shukla

When an MVC4 application starts, the Application_Start() method is called. This method is calls the RegisterRoutes() method. Which is creates the route table.


---

Original Source: https://www.mindstick.com/interview/1590/how-route-table-is-created-in-asp-dot-net-mvc4

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
