1
votes

I have this initial configuration in my route.config.

  • routes.MapRoute( name: "ALBUMS", url: "albums/", defaults: new { controller = "Templates", action = "Connections", id= UrlParameter.Optional });

enter image description here

Now how should I specify that anything after /albums/, like

  1. /albums/bollywood
  2. /albums/bollywood/hindi
  3. /albums/tollywood
  4. /albums/bollywood/hindi/old
  5. /albums/bollywood/hindi/old/kishore

like this chain goes on. How to configure if url starts with /albums/ , please render routes.MapRoute( name: "ALBUMS", url: "albums/", defaults: new { controller = "Templates", action = "Connections", id= UrlParameter.Optional });

Because I don't have any bollywood,tollywood actions. In actual, I have Welcome controller and action Selected.. thats it. All others are templates.

1

1 Answers

2
votes

try

 routes.MapRoute(
                name: "Album",
                url: "Album/{*anything}",
                defaults: new { controller = "Album",action = "Index",id = UrlParameter.Optional }
            );

(if you also have the default route, this should go before it)