On the contrary, when building ASP. NET MVC Applications In ASP. net mvc applications, a URL corresponds to a controller action rather than a page file on the hard disk.
In traditional ASP. net and ASP applications, browser requests are mapped to the page, in ASP. net MVC applications, browser requests are mapped to Controller behavior, Asp.. NET applications are content-centric. On the contrary, Asp.. Net MVC applications are centered on application logic.
Understanding URL Routing
Browser requests are mapped to Controller behavior through a URL routing feature of ASP. net mvc. url routing routes inbound requests to Controller behavior.
URL routing uses a route table to process inbound requests. When your application is started for the first time, this route table is configured in global. in the asax file, the default MVC global. the content of the asax file is shown in Listing 1.
Listing 1 Global. asax
Public Class GlobalApplication
Inherits System.Web.HttpApplication
Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
routes.IgnoreRoute("{resource}.axd/{*pathInfo}")
' MapRoute takes the following parameters, in order:
' (1) Route name
' (2) URL with parameters
' (3) Parameter defaults
routes.MapRoute( _
"Default", _
"{controller}/{action}/{id}", _
New With {.controller = "Home", .action = "Index", .id = ""} _
)
End Sub
Sub Application_Start()
RegisterRoutes(RouteTable.Routes)
End Sub
End Class