Interviews7 answers
What is routing in MVC?
7 Answers
Routing is a mechanism in MVC that decides which action method of a controller class to execute. Without routing there's no way an action method can be mapped. to a request. Routing is a part of the MVC architecture so ASP.NET MVC supports routing by default
Dhaval PatelPosted Sep 27, 2018, 8:00 PM EDT
for asp.net mvc routing is a path selection mechanism which is written in RouteConfig.cs class file which is present inside the application.
Its main task is to create the route table which is invoked when a http request comes into the scenario and call the action method of the desired controller.
Rajan MishraPosted Sep 26, 2018, 1:43 AM EDT
ASP.NET introduced Routing to eliminate needs of mapping each URL with a physical file. Routing enable us to define URL pattern that maps to the request handler. Routing is URL pattern matching technique which manages incoming request and based on controller name and action method name it maps to URL and executes action method.
Jignesh KumarPosted Jun 11, 2018, 7:59 PM EDT
Basically, Routing is a pattern matching system that monitors the incoming request and figures out what to do with that request. At runtime, Routing engine uses the Route table for matching the incoming request's URL pattern against the URL patterns defined in the Route table.
Dhrutika RathodPosted May 15, 2018, 11:57 PM EDT
to work with url and effective navigation between pages is called routing
Manav PandyaPosted Feb 8, 2018, 12:31 AM EST
Routing is a mechanism in MVC that decides which action method of a controller class to execute. Without routing there's no way an action method can be mapped. to a request. Routing is a part of the MVC architecture so ASP.NET MVC supports routing by default.
Ritesh SinghPosted Aug 22, 2017, 2:40 AM EDT
Routing helps you to define a URL structure and map the URL with the controller.
For instance let’s say we want that when a user types “http://localhost/View/ViewCustomer/”, it goes to the “Customer” Controller and invokes the DisplayCustomer action. This is defined by adding an entry in to the routes collection using the maproute function. Below is the underlined code which shows how the URL structure and mapping with controller and action is defined.
routes.MapRoute(
"View", // Route name
"View/ViewCustomer/{id}", // URL with parameters
new { controller = "Customer", action = "DisplayCustomer",
id = UrlParameter.Optional }); // Parameter defaults
Chinmaya DashPosted Oct 13, 2016, 10:41 AM EDT






