1
I have the following route, where I get the representative’s id: http://localhost:18568/Representative/Index/1
So it’s working, but I’d like to show the representative’s name http://localhost:18568/representative’s name /Index/Jsblabla
in my Maproute I am doing so unsuccessfully
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Representante",
url: "nome-do-representante/Index/{chave}",
defaults: new { controller = "Representante", action = "Index" },
constraints: new { chave = @"^[a-zA-Z0-9\-\/_]{2,}$" }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
Murilo, I can’t understand how this would go employee, I took a test is nothing changed
– Harry
I’m gonna fix something I screwed up and it’s gonna work. Keep an eye out
– user26552