내 영역이 아래입니다. 해당 부분 만 강조 표시됩니다.하위 폴더의 컨트롤러
경로 테이블
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
);
}
This only works when the url is like this
localhost:2474/SOProblems/ChildController/index
This does not works when the url is like this
localhost:2474/SOProblems/SubFolder/ChildController/index
당신이없는 걸 말해 주시겠습니까?
"작동하지 않음"은 정확히 무엇을 의미합니까? – TGlatzer
@ Grumbler85 - 마지막 시도한 URL은 404, –
입니다. Backtick은 여기에 "SubFolder'/ChildController"입니까? 그리고 하위 폴더 내의 네임 스페이스가 올바르게 설정되어 있는지 확인하십시오. – TGlatzer