RouteCollection routes = new RouteCollection(); routes.Add("Default", new Route("{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" }));
RouteCollection routes = RouteTable.Routes; Route route = routes.GetRouteData(HttpContext.Current).Route;This example retrieves the RouteCollection from the RouteTable, and then uses the GetRouteData method to get the current route for the current HTTP context. The Route object can then be used to extract information about the current request. Package Library: System.Web.dll.