我仍然在阅读global.asax上的路线时苦苦挣扎....我可以看到URL是
funnelweb /管理/登录
路线是:
// Due to a bug in the .AddServiceRoute<>() method in WCF we have to do this work around.
// see http://wcf.codeplex.com/workitem/9 for bug description
// Workaround caches all service route urls, removes the service routes. Adds a constraint to the wiki page route
// then re-adds the service routes at the end.
var serviceRoutes = routes
.OfType<ServiceRoute>()
.ToList();
var serviceRoutesUrls = serviceRoutes
.Select(serviceRoute => serviceRoute.Url.Replace("{*pathInfo}", ""))
.ToArray();
var notAService = new NotFromValuesListConstraint(serviceRoutesUrls.ToArray());
var defaultConstraint = new { page = notAService };
foreach (var serviceRoute in serviceRoutes)
{
routes.Remove(serviceRoute);
}
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*allaxd}", new { allaxd = @".*\.axd(/.*)?" });
routes.IgnoreRoute("pingback");
if (builder != null)
AreaRegistration.RegisterAllAreas();
// Feeds
routes.MapLowerCaseRoute("feed", new { controller = "Feed", action = "Feed", feedName = (string)null });
routes.MapLowerCaseRoute("feeds/{*feedName}", new { controller = "Feed", action = "Feed" });
routes.MapLowerCaseRoute("commentfeed", new { controller = "Feed", action = "CommentFeed" });
// Upload
routes.MapLowerCaseRoute("get/{*path}", new { controller = "Upload", action = "Render", area = "Admin" });
// Resources
routes.MapLowerCaseRoute("robots", new { controller = "Resource", action = "Render", fileName = "/Content/Resources/Robots.txt", contentType = "text/plain" });
routes.MapLowerCaseRoute("robots.txt", new { controller = "Resource", action = "Render", fileName = "Content/Resources/Robots.txt", contentType = "text/plain" });
routes.MapLowerCaseRoute("humans.txt", new { controller = "Resource", action = "Render", fileName = "Content/Resources/Humans.txt", contentType = "text/plain" });
routes.MapLowerCaseRoute("humans", new { controller = "Resource", action = "Render", fileName = "Content/Resources/Humans.txt", contentType = "text/plain" });
routes.MapLowerCaseRoute("favicon", new { controller = "Resource", action = "Render", fileName = "{Theme}/Content/Images/favicon.ico", fileName2 = "/Content/Resources/favicon.ico", contentType = "image/vnd.microsoft.icon" });
routes.MapLowerCaseRoute("favicon.ico", new { controller = "Resource", action = "Render", fileName = "{Theme}/Content/Images/favicon.ico", fileName2 = "/Content/Resources/favicon.ico", contentType = "image/vnd.microsoft.icon" });
routes.MapLowerCaseRoute("favicon.png", new { controller = "Resource", action = "Render", fileName = "{Theme}/Content/Images/favicon.png", fileName2 = "/Content/Resources/favicon.png", contentType = "image/png" });
routes.MapLowerCaseRoute("status", new { controller = "Resource", action = "Render", fileName = "/Content/Resources/Status.html", contentType = "text/html" });
// Site Map
routes.MapLowerCaseRoute("sitemap", new { controller = "Wiki", action = "SiteMap" });
routes.MapLowerCaseRoute("sitemap.xml", new { controller = "Wiki", action = "SiteMap" });
// Tags
routes.MapLowerCaseRoute("tag/{*tagName}", new { controller = "Tag", action = "Index" });
// Tagged Pages
routes.MapLowerCaseRoute("tagged/{*tag}", new {controller = "Tagged", action = "Index"});
// Wiki
routes.MapLowerCaseRoute("blog", new { controller = "Wiki", action = "Recent", pageNumber = "0" });
routes.MapLowerCaseRoute("blog/{pageNumber}", new { controller = "Wiki", action = "Recent" }, new { pageNumber = "\\d+" });
routes.MapLowerCaseRoute("", new { controller = "Wiki", action = "Home", pageNumber = "0" });
routes.MapLowerCaseRoute("{pageNumber}", new { controller = "Wiki", action = "Home" }, new { pageNumber = "\\d+" });
routes.MapLowerCaseRoute("search", new { controller = "Wiki", action = "Search" });
routes.MapLowerCaseRoute("unpublished", new { controller = "WikiAdmin", Area = "Admin", action = "Unpublished" });
routes.MapLowerCaseRoute("admin/new", new { controller = "WikiAdmin", Area = "Admin", action = "Edit", page = "" });
routes.MapLowerCaseRoute("edit/{*page}", new { controller = "WikiAdmin", Area = "Admin", action = "Edit", page = UrlParameter.Optional });
routes.MapLowerCaseRoute("revert/{*page}", new { controller = "WikiAdmin", Area = "Admin", action = "Revert" });
routes.MapLowerCaseRoute("via-feed/{*page}", new { controller = "Resource", action = "Render", fileName = "/Content/Images/Transparent.gif", contentType = "image/gif" });
routes.MapLowerCaseRoute("history-of/{*page}", new { controller = "Wiki", action = "Revisions" });
routes.MapLowerCaseRoute("trackbacks-for/{*page}", new { controller = "Wiki", action = "Pingbacks" });
// Remove .aspx
routes.Add(new RedirectRoute("(?<page>[a-zA-Z0-9/\\-\\._\\+ ]+)\\.aspx", new MvcRouteHandler()) { ReplacePattern = "/$1" });
routes.Add(new RedirectRoute("(?<page>rss)$", new MvcRouteHandler()) { ReplacePattern = "feed", ResponseCode = 302});
routes.MapLowerCaseRoute("{*page}", new { controller = "Wiki", action = "Page" }, defaultConstraint);
foreach (var serviceRoute in serviceRoutes)
{
routes.Add(serviceRoute);
}
无法确定我的意思是如何解决它的发展方向。因为似乎没有匹配/ admin / login ...?
答案 0 :(得分:1)
也许你有一个注册路线的区域。还有,你试过一瞥吗? Glimpse将向您展示使用的路线。 http://getglimpse.com/
答案 1 :(得分:0)
刚刚尝试了FunnelWeb博客,我发现管理员/登录的路径在
\ FunnelWeb \ SRC \ FunnelWeb.Web \领域\管理员\ RouteConfig.cs
context.MapRoute(
"Admin_Login",
"admin/login/{action}",
new { controller = "Login", action = "Login" }
);