public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute("Defaults", "{controller}/{id}.html", new { controller = "Home", action = "Info", id = UrlParameter.Optional }, new { controller = @"News|Solutions" }, new[] { "Web.UI" }); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }, namespaces: new string[1] { "Web.UI" } ); }
然后在Web.config 的<system.webServer>节点下添加<modules runAllManagedModulesForAllRequests="true" />
时间: 2025-01-15 22:44:38