1 public static void RegisterRoutes(RouteCollection routes) 2 { 3 routes.MapRoute("", "{controller}/{action}.html", new { controller = "Home", action = "Index" }); 4 }
当使用这条路由时,在地址栏输入地址(http://xxx.com/Home/Index.html)后显示 404 错误。
这样修改路由后,输入地址(http://xxx.com/Home/Index_html)可以正常访问。
1 public static void RegisterRoutes(RouteCollection routes) 2 { 3 routes.MapRoute("", "{controller}/{action}_html", new { controller = "Home", action = "Index" }); 4 }
怎样才能使用“.”呀?这个问题要如何解决呀?