我有一個應用程序,我正在使用全局路由來查詢當前路徑並返回頁面特定的數據。我有路線設置這樣的...asp.net MVC3全局路由和硬編碼路由
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Pages",
"Pages",
new { controller = "Pages", action = "Index" });
routes.MapRoute(
"Navigation",
"Navigation",
new {controller = "Navigation", action = "Index"});
routes.MapRoute(
"Default", // Route name
"{*url}", // URL with parameters {controller}/{action}/{id}
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
我面臨的問題是,當我去/頁嘗試並添加新的頁面,在火災的PageController像它應該,但調試後,當去/頁的應用程序然後請求HomeController。我在路由設置中丟失了什麼?
請求什麼網址? – SLaks