what is the entry point for an asp.net mvc 4 application?
There is an application_start()
method in global.asax.cs.
As for the controller's concern for the request, its starts in the constructor of the controller then the method for the requested action.
The Global.asax.cs
file, where there is the start method Application_Start
might be what you are looking for. That is the code which is run when the app starts.
protected void Application_Start()
{
...
RouteConfig.RegisterRoutes(RouteTable.Routes);
...
}
But looking at the url you have posted it might be the HomeController
or DirectoryController
file. Unfortunately, I cannot tell that from looking at your route.
A sample route register code is as below where we can see that
The URL /{controller}/{action}/{id}
The default for controller/action/id is Home/Index/optional
So if you run your web with the starting url as http://localhost:52763/
, it is indeed will call http://localhost:52763/Home/Index
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
It's HTTP. You make a request to the web server for a resource, as you have specified above, and the controller responds.
So in ASP.NET MVC, you have multiple entry points: each action method.
MSDN Controllers and Action Methods in ASP.NET MVC