【发布时间】:2008-12-12 16:15:32
【问题描述】:
ASP.NET MVC 路由在映射时具有名称:
routes.MapRoute(
"Debug", // Route name -- how can I use this later????
"debug/{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = string.Empty } );
有没有办法获取路线名称,例如上例中的“调试”?我想在控制器的 OnActionExecuting 中访问它,以便在调试时可以在 ViewData 中设置内容,例如,通过在 URL 前加上 /debug/...
【问题讨论】:
标签: asp.net-mvc model-view-controller routing