2
我有我通過這樣的RedirectToRoute呼叫路由匹配global.asax中的路由是這樣的:MVC預覽4在路由表中的路由提供的值
routes.MapRoute(
"Super-SuperRoute", // Route name
"Super.mvc/SuperRoute/{year}", // URL with parameters
new { controller = "Super", action = "SuperRoute", id = "RouteTopic" } // Parameter defaults
);
那麼,爲什麼我會得到錯誤:「路由表中沒有路由匹配提供的值。「?
我看到selectedYear的類型是var。當我試圖用int.Parse轉換爲int時,我意識到selectedyear實際上是null,這將解釋這些問題。我想下次我會更加關注變量的值在斷點:)