Application_Start()
method ofGlobal.asax file.We can find RouteConfig.cs file under App_Start folder in ASP.NET MVC 5 application. If we follow this method inRouteConfig class, we will find one default configured route as follows. Line # 03 to #07 is configuring one default route.
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
No comments:
Post a Comment