I am developing a project in mvc it has been working fine, but I have not been able to solve an error, I try to access a url that creates from global asax with parameters but it sends me error 404
routes.MapRoute(
"Unit",
"Home/Unit/{id}/{name}",
new { controller = "Home", action = "Unit", id = UrlParameter.Optional }
);
here I create the route in jquery, I add the path to a div with text
$('#nombreUnidad').append("<a href='Unit/" + param.Unidad.Id + "/" + param.Unidad.NombreUnidad + "'>Nombre: " + param.Unidad.NombreUnidad + "</a>");
so is my actionresult from my controller
public ActionResult Unit(int id, string name)
{
return View("~/Views/Home/Unit.cshtml");
}
the other routes that only have views and do not have parameters if they work