How can I get the route name in controller in ASP.NET MVC?

前端 未结 6 2044
我在风中等你
我在风中等你 2020-11-28 22:45

ASP.NET MVC routes have names when mapped:

routes.MapRoute(
    \"Debug\", // Route name -- how can I use this later????
    \"debug/{controller}/{action}/{i         


        
6条回答
  •  猫巷女王i
    2020-11-28 22:49

    another option - use MapRoute with string[] namespaces argument, then you can see your namespaces as RouteData.DataTokens["Namespaces"]

提交回复
热议问题