Explain what is routing in MVC? What are the three segments for routing important?Report
Routing is a mechanism to process the incoming url that is more descriptive and give desired response. In this case, URL is not mapped to specific files or folder as was the case of earlier days web sites.There are two types of routing (after the introduction of ASP.NET MVC 5).Convention based routing: to define this type of routing, we call MapRoute method and set its unique name, url pattern and specify some default values.
Attribute based routing: to define this type of routing, we specify the Route attribute in the action method of the controller.Routing is the URL pattern that is mappped together to a handler,rounting is responsible for incoming browser request for particular MVC controller. In other ways let us say routing help you to define a URL structure and map the URL with controller. There are three segments for routing that are important,