매우 이상한 라우팅 문제가 있습니다.ASP.NET MVC 3 영역의 라우팅 문제
지역을 사용하는 ASP.NET MVC 3 사이트가 있습니다. '자원 수 - 때 요청이 나는 "404 얻을 URL을 나는 다음과 같은 URL을 요청하면
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
null,
"Assets/{controller}/{action}/{code}",
null,
new { code = @"(\w{2,3}$)" }
);
context.MapRoute(
"Assets_default",
"Assets/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
);
}
가 완벽하게
http://site.com/Assets/Gallery/GetByCode/AEP
http://site.com/Assets/Gallery/GetByCode/MEC
http://site.com/Assets/Gallery/GetByCode/GP
http://site.com/Assets/Gallery/GetByCode/BR2
http://site.com/Assets/Gallery/GetByCode/ZZZ
http://site.com/Assets/Gallery/GetByCode/123
작동하지만 : 나는 자산 영역에서 다음 경로 설정이 t을 찾을 수 없습니다 "오류
http://site.com/Assets/Gallery/GetByCode/PRN
http://site.com/Assets/Gallery/GetByCode/prn
다른 모든 URL이 작동했습니다. 문제가있는 PRN 인 것 같습니다.
GalleriesController> GetByCode 작업의 시작 부분에 중단 점을 넣었으며 PRN 경로는 (404 오류가 제시하는 것처럼) 작업을 입력하려고 시도조차하지 않습니다.
누구나 PRN이 경로에서 작동하지 않는 이유가 있습니까? 아니면 내가 조사 할 수있는 또 다른 것? 당신의 도움이 Saan
이'Index' 작업을 수행하는 대신 맞고? – simonlchilds
아니요 - 색인이 맞지 않습니다. – Saan
경로에서 정규식 구속 제거를 시도 했습니까? 기본 경로에있는 것과 동일한 순서로 매개 변수를 넣으려고 했습니까? – simonlchilds