我想獲得以下路線網址:ASP.NET MVC路由返回null
RouteTable.Routes.MapRoute(
null,
"cinema",
new
{
Controller = "CinemaListings",
Action = "ShowCinemaLandingPage",
SiteArea = "CinemaTimes",
MainLandingPage = true
});
我已嘗試以下方法生產的網址:
<%:Url.Action("ShowCinemaLandingPage", "CinemaTimes", new { SiteArea = "CinemaTimes", MainLandingPage = true})%>
<%:Url.RouteUrl(new { Controller = "CinemaTimes", Action = "ShowCinemaLandingPage", SiteArea = "CinemaTimes", MainLandingPage = true })%>
我我也試過只用控制器和動作名稱。我返回空 - 我錯過了什麼?
What'type'是SiteArea?它是一個字符串參數嗎?你能向我們展示控制器/動作與這個映射的參數嗎? –