私は次のURLを持っています
- URL/説明
- URL/ホーム/メンバー/説明
- URL/ホーム/説明
これが私のルートです
上記の#1の場合:
routes.MapRoute(
name: "DescriptionNoController",
url: "{d}",
defaults: new {controller = "Home", action = "Index", d = UrlParameter.Optional}
);
上記の#2の場合:
routes.MapRoute(
name: "DescriptionDefault",
url: "{controller}/{action}/{d}",
defaults: new {controller = "Home", action = "Index", d = UrlParameter.Optional}
);
#3で問題が発生しました。
できると思った
routes.MapRoute(
name: "DescriptionDefaultNoAction",
url: "{controller}/{d}",
defaults: new { controller = "Home", action = "Index", d = UrlParameter.Optional }
);
しかし、これは無限ループを作成します。基本的に、#3の例で「ホーム/説明」をホームコントローラーとインデックスアクションにマップする必要があります。助けていただければ幸いです!