Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Significance of the Route Name in MVC 4

I was looking at the Routing Concepts of MVC and specifically at the below line:

routes.MapRoute(
 "Default", // Route name
 "{controller}/{action}/{id}", // Route Pattern
 new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Default values.
 );

Everything's fine, but I don't get the significance of the Route Name.

Is it just a term out there ? or is there anything significant with it ?

Am I missing using it or where are the places it is used in MVC 4 ?

Thanks in advance.

like image 593
now he who must not be named. Avatar asked Oct 11 '13 11:10

now he who must not be named.


1 Answers

Am I missing using it or where are the places it is used in MVC 4 ?

There are Helper methods that use the route name.

See for example the RouteLink and RouteUrl methods :

like image 117
jbl Avatar answered Sep 21 '22 19:09

jbl