0

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
            );
4

1 に答える 1

0

ダミーページを空白ページとして作成し、Response.Redirect to home pageを追加しました。これは問題の解決策ではありませんが、回避しました。

于 2011-01-13T12:40:37.707 に答える