【发布时间】:2015-09-09 07:13:28
【问题描述】:
我知道在 mvc 中,在应用程序启动时 RegisterRoutes 方法在 glabal.asax 的 Application_Start 事件处理程序中被调用。有一个称为 RouteCollection 的路由集合,其中包含应用程序中所有已注册的路由。 RegisterRoutes 方法在此集合中注册路由。 但我想知道这个路由表在 IIS 中的位置。我怎样才能找到它。例如。我正在运行默认的 mvc 应用程序,在哪里可以找到此路由表。
protected void Application_Start()
{
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
【问题讨论】:
-
你为什么在你的帖子中引用 BundleConfig?
-
不清楚您的要求。您的问题是关于路线的,但您的代码与捆绑包有关。
-
更新了正确的代码。
标签: c# asp.net-mvc asp.net-mvc-4 routes