我在同一域名下有几个MVC应用程序,每个应用程序都有自己的目录。
mydomain.com/app1
mydomain.com/app2
etc..
当在根级别使用Url.Content()和Url.Action()时,URL中的"app1"部分会重复出现两次。
// code used to generate the links
<%= Url.Action("tetris", "Apps") %>
Page Url: mydomain.com/app1/ rendered link (broken): mydomain.com/app1/app1/Apps.aspx/tetris application root appears twice in the rendered url when at the root directory
Page Url: mydomain.com/app1/home.aspx/ rendered link (works): mydomain.com/app1/Apps.aspx/tetris application root appears once - everything works as expected
我的路由 - 我正在使用Phil haack博客文章中的路线。
routes.MapRoute(
"Default",
"{controller}.aspx/{action}/{id}",
new { action = "Index", id = "" }
);
routes.MapRoute(
"Root",
"",
new { controller = "Home", action = "Index", id = "" }
);
有什么想法吗?