C# mvc 路由坑
配置先读取自定义路由,在访问默认路由。
routes.MapRoute(
name: "Code",
url: "{id}.html",
defaults: new { controller = "Products", action = "Details", id = "" });
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional }
);
//加上自定义路径访问权限
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
</modules>
</system.webServer>