を返す:ASP.NET MVCのルーティングは、私は、次のルートのURLを取得しようとしていますヌル
RouteTable.Routes.MapRoute(
null,
"cinema",
new
{
Controller = "CinemaListings",
Action = "ShowCinemaLandingPage",
SiteArea = "CinemaTimes",
MainLandingPage = true
});
私はURLを生成するには、次の方法を試してみた:
<%:Url.Action("ShowCinemaLandingPage", "CinemaTimes", new { SiteArea = "CinemaTimes", MainLandingPage = true})%>
<%:Url.RouteUrl(new { Controller = "CinemaTimes", Action = "ShowCinemaLandingPage", SiteArea = "CinemaTimes", MainLandingPage = true })%>
私は」コントローラー名とアクション名だけを試してみました。返されたnullが返されます - 何が欠けていますか?
「タイプ」とは何ですか?SiteArea?文字列パラメータですか?これにマップされているパラメータを使用してコントローラ/アクションを表示できますか? –