URLが
http:// localhost:54027 / test1 / test2 / home
の
場合
ホームページが表示さ
れますURLがhttp:// localhost:54027 / test1 / test2 /の場合空白
ページ
が表示されます以下は、使用したルートです。
routes.MapRoute(
"HomePage",
"Test2",
new { controller = "Home", action = "Index", id = "", title = UrlParameter.Optional }
);
routes.MapRoute(
"ProductDetails", // Route name
"Test2/", // URL with parameters
new { controller = "Home", action = "Index", id = "", title = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
"Default",
"Test2/{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "1" }
);
次のURLを試してみると、正常に機能します
http:// localhost:54027 / test1 / test2 / '
routes.MapRoute(
"ProductDetails", // Route name
"Test2/{'}", // URL with *** ' *** parameters
new { controller = "Home", action = "Index", id = "", title = UrlParameter.Optional } // Parameter defaults
);