Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想创建一个像这样路由的自定义路由
当客户端请求http://server/logout 时,它将被定向到 AccountController 控制器和 LogOff 方法
http://server/logout
如何在 ASP.MVC 4 中执行此操作?
您可以在默认路由之前插入以下路由定义:
routes.MapRoute( name: "LogOut", url: "logout", defaults: new { controller = "Account", action = "LogOff" } );