In this article, I am sharing my thoughts on creating a routing system in an MVC application and the terminology being used.
Here we go
RouteData
This mechanism is used to examine an incoming URL and then decide which controller and action the request needs to do the send.
Open your Visual Studio, click on "File" -> "New" -> "Project..." and select ASP.NET MVC3 Web Application, as in the following:

Specify whatever name of your first application that you desire and click "Ok".
A new window will appear, from that window I chose Intranet application where there are many options. Another interesting fact is that there is a dropdown named "View Engine"; I selected Razor (which is more specific to MVC 3 and MVC 4) and I kept the checkbox "Create a new unit test" unchecked.

Click on the "Ok" button.
The following depicts what the default screen is that comes after clicking on the "OK" button having multiple folder's.

Let's go into more detail for this. Routing is defined in the Global.asax; open the file, and you will see the following lines of code:

We need to make some adjustements in this to understand how routing works. The Application_Start method is responsible for registering the RegisterRoutes method. This Application_Start method is called by the ASP.NET platform when the application is first started.
Let's see what happens when we run our application first time with the default routing settings.

Also for the About page I hit this URL http://localhost:53098/Home/About


The job of the routing system is to verify the incoming URL request and determine the value of segment variables; segment variables are defined using curly braces {}.
Defaults Values
- routes.MapRoute(
- "Default", // Route name
- "{controller}/{action}/{id}", // URL with parameters
- new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
- );


Join the conversation! Your thoughts help the community grow.