0
I’m having a problem with my project. I have two routes, a "Default" and a test, but I do not know if it is done correctly because it does not work when they put in the url what I put there, works only the "Default"
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"TestRoute",
"{id}",
new { controller = "Inicio", action = "Inicio", id = UrlParameter.Optional },
new { id = @"\d+" } //one or more digits only, no alphabetical characters
);
//default route
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Inicio", action = "Inicio", id = UrlParameter.Optional }
);
}
Any type of route I create (even if the default is removed) only works the page when I call {controller}/{action}
– luckakashi