I am not an advanced developer. I just started working with MVC. Few days back I had seen an example of ASP.NET MVC routing code where two controller or action name has been referenced.
routes.MapRoute(
name: "test",
url: "{controller}/{action}/{page}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
defaults: new { action = "Index" }
);
Just started working with ASP.NET MVC, so I am curious to know what is the objective to mention controller or action name twice in routing code?
In above example there are two defaults.... When and why is it required?
Just requesting some one to explain the same with a nice example.
Thanks in advance.