我想获得以下路线网址: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?它是一个字符串参数吗?你能向我们展示控制器/动作与这个映射的参数吗? –