What is routing in MVC?
1108
15-Oct-2019
Updated on 17-Sep-2020
Anonymous User
15-Oct-2019Routing helps you to define a URL structure and map the URL with the controller.
Let us try to understand this with an example, - when we want that when a user types "http: // localhost / View / ViewCustomer /", it goes to the "Customer" controller and the DisplayCustomer action Invites you. This is defined by adding an entry into the routes collection using the map_route function. Below is the underlined code which shows how the URL structure and mapping with controller and action are defined.
And the route mapping code is written in "RouteConfig.cs" file and registered using "global.asax" application start event.