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 添加到主页这不是问题的解决方案,但我们解决了它。

于 2011-01-13T12:40:37.707 回答