我希望使用以下网址并相应地映射一些路线
<domain>/Home/About
<domain>/Home/SiteList
<domain>/Site/<id>/ (this one is defaulted to the details view)
<domain>/Site/<id>/section1/ (this one goes to section1 route in the Site controller)
<domain>/Site/<id>/section2/ (this one goes to section2 route in the Site controller)
e.g.
<domain>/Site/london/siteinfo
以上内容涵盖
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
但是,我也想使用以下路线
<domain>/Site/<siteid>/section1/controller/action (where controller gets data linked to the <siteid> and action is optional)
一个示例链接是:
<domain>/Site/london/siteinfo/manager (manager is a controller and will list managers for the site)
如果尝试了各种路线并阅读了各种帖子,但找不到任何适用于我的东西。
任何人都可以提供一些帮助吗?
谢谢鲁迪