我有这条路线:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Funcionario",
"{funcionario}",
new { controller = "Funcionario", action = "Index", funcionario = UrlParameter.Optional },
new string[] { "Route.Controllers" }
);
routes.MapRoute(
"Servico",
"{funcionario}/{servico}",
new { controller = "Funcionario", action = "Servico", funcionario = UrlParameter.Optional, servico = UrlParameter.Optional },
new string[] { "Route.Controllers" }
);
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = @"\d+" }, // Parameter defaults
new string[] { "Route.Controllers" }
);
}
但我无法访问我的主页/索引。例如:
在职的
http://mydomain.com/pablo/cozinha
http://mydomain.com/home/index/0
不工作