作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我的路由表,在其中放置各种“ .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());
最佳答案
只需确保第一部分或URL以.aspx结尾,例如:
this._Routes.MapRoute("WorkerProfileLeader", "Department.aspx/{departmentId}/Worker/Profile/Leader/List/{viewType}", ...
this._Routes.MapRoute("Default", "{controller}.aspx/{action}", MVC.Home.Index());
关于asp.net-mvc - 部署ASP.NET MVC IIs6.0如何将路由更改为包括.aspx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1090409/
我是一名优秀的程序员,十分优秀!