문제

ASP.NET MVC 2.0 미리보기 1 앱을 받았으며 자체 경로가 포함 된 일부 영역을 만들기 시작했습니다.

메인 프로젝트에서 이러한 경로를 덮어 쓰는 방법을 원합니다. 물론 같은 이름의 새 경로를 추가 할 수 없습니다. Routetable.routes.Remove (RouteBase 항목)를 볼 수 있지만 사용 방법을 잘 모르겠습니다.

//Need to remove "PostIndex" before adding it again
routes.MapAreaRoute(
                "OurAreaNameSpace",
                "PostIndex",
                "post/index/{currentPage}",
                new { controller = "Post", action = "Index", currentPage = "" },
                new string[] { "OurAreaNameSpace.Controllers" }
            );
도움이 되었습니까?

해결책

이것에서 어떻게합니까?

RouteTable.Routes.Remove(RouteTable.Routes["PostIndex"]);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top