Then #
I have two routes.MapRoute()
routes.MapRoute(
"Home",
"Image/{id}",
new
{
controller = "Home",
action = "Image",
id = UrlParameter.Optional
},
new { id = @"\w+" }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
And an Action
public ActionResult Image(string id)
{
Debug.WriteLine(id);
return View();
}
Both Map.Route()
will work, but in that case it would fall into the first option (because both are correct but the one that comes first is used), but if Map.Route()
called "Home" did not work, I would not know in which Map.Route()
would be falling when I call Action "Image"