how write custom route
Custom code must be place inside the RouteConfig.cs.
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute( "MultipleUrls", "{phaseone,phasetwo}", new { controller = "home", action = "index", id = "" } );
routes.MapRoute(name: "Default", url: "{controller}/{action}/{id}",defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } );
}
}
No comments:
Post a Comment