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>

posted @ 2017-05-04 21:21  suifengpiao  阅读(890)  评论(0编辑  收藏  举报