我的区域在下面。仅突出显示相关部分。
路由表
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"SubFolder", // Route name
"SubFolder/ChildController",
new { controller = "ChildController", action = "Index" },
new[] { "Practise.Areas.SOProblems.Controllers.SubFolder" });
routes.MapRoute(
"Default", // Route name
"{controller}/{action}", // URL with parameters
new { controller = "Home", action = "Index" } // Parameter defaults
);
}
这仅在 url 是这样的时候才有效
localhost:2474/SOProblems/ChildController/index
当 url 是这样时,这不起作用
localhost:2474/SOProblems/SubFolder/ChildController/index
你能告诉我缺少什么吗?