正如Phil Haack在他的博客文章中解釋的那樣,Route Debugger可以幫助您查看路由表。然而
我的網站得到它的路由通過(使用Unity)的MVCTurbine依賴注入,像這樣注入:注入路由註冊時,在哪裏調用RouteDebugger.RewriteRoutesForTesting()?
public class DefaultRoutRegistration : IRouteRegistrator
{
public void Register(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Accounts",
"Accounts/{userName}/{action}",
new { controller = "Account", action = "Index" }
);
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);
}
}
確切位置在哪裏我可以在該RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes)拋出;重寫我的路由表?
仙=(沒有找到問題的愛.. – 2010-04-07 16:47:59