2009-07-07 4 views
3

이것은 내 라우팅 테이블로 다양한 '.aspx'등록을해야합니까?asp.net mvc iis6.0 배포 방법 .aspx를 포함하는 경로 변경 방법

//Turns off the unnecessary file exists check 
this._Routes.RouteExistingFiles = true; 

//Ignore text, html, xml files. 
this._Routes.IgnoreRoute("{file}.txt"); 
this._Routes.IgnoreRoute("{file}.htm"); 
this._Routes.IgnoreRoute("{file}.html"); 
this._Routes.IgnoreRoute("{file}.xml"); 

//Ignore axd files such as assest, image, sitemap etc 
this._Routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 

//Ignore the assets directory which contains images, js, css & html 
this._Routes.IgnoreRoute("Assets/{*pathInfo}"); 

//Ignore the error directory which contains error pages 
this._Routes.IgnoreRoute("ErrorPages/{*pathInfo}"); 

//Exclude favicon (google toolbar request gif file as fav icon) 
this._Routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.([iI][cC][oO]|[gG][iI][fF])(/.*)?" }); 

//Photo routes 
this._Routes.MapRoute("PhotoAssets", "Photos/Photo/{photoId}/Size/{photoSizeClassificationId}", MVC.Photo.Photo(0, null)); 

//Handles department profile routes 
this._Routes.MapRoute("WorkerProfileLeader", "Department/{departmentId}/Worker/Profile/Leader/List/{viewType}", MVC.WorkerProfile.List(PersonType.Leader, "", DisplayViewType.SummaryThumbnailList)); 
this._Routes.MapRoute("WorkerProfile", "Department/{departmentId}/Worker/Profile/{personType}/List/{viewType}", MVC.WorkerProfile.List(PersonType.Pleb, "", DisplayViewType.ThumbnailGrid)); 
this._Routes.MapRoute("WorkerProfilePerson", "Department/{departmentId}/Worker/Profile/{personType}/Detail/{personId}", MVC.WorkerProfile.Detail(PersonType.Pleb, "", "")); 

//Default route mapping 
this._Routes.MapRoute("Start", "Default.aspx", MVC.Home.Index()); 
this._Routes.MapRoute("Default", "{controller}/{action}", MVC.Home.Index()); 

건배 앤서니

+0

와일드 카드 설정을 원하지 않습니까? 필 haack에 의해 설명 된대로 – DevelopingChris

답변

1

그냥 첫 번째 부분 확인하거나 URL 같은 에서 .aspx로 끝나는 : 나는 그것이 사실 중요하지 않습니다 확신

this._Routes.MapRoute("WorkerProfileLeader", "Department.aspx/{departmentId}/Worker/Profile/Leader/List/{viewType}", ... 
this._Routes.MapRoute("Default", "{controller}.aspx/{action}", MVC.Home.Index()); 
+0

건배 건 내가 알고 싶었 그게 –

0

URL에있는은 어딘가에있는 한 .aspx만큼 길며 파일 확장자로 보이는 첫 번째 것입니다. 사실, 내가 본 한 가지 트릭은 응용 프로그램이 들어있는 폴더 이름에 .aspx를 넣는 것입니다! 즉, 응용 프로그램 이름 자체는 "myapp.aspx"이지만 폴더 일뿐입니다.

.aspx가 경로의 첫 번째 파일 확장명으로 표시되는 한 IIS는 해당 파일 확장명을 사용하여 요청을 처리합니다.

+0

건배 그걸 몰랐어 ... –