Try our conversational search powered by Generative AI!

Custom routing

Vote:
 

Hi,

Based on the below topic,

https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2017/3/custom-routing-with-extra-parameters-in-action-method/

I am trying to create multiple parameters routing. The route config is below

RouteTable.Routes.MapContentRoute(
"listing",
"{language}/{node}/{controller}/{action}/{category}/{id}",
new
{
controller = "ListingPage",
action = "Index",
category = UrlParameter.Optional,
id = UrlParameter.Optional
});

so the url will be /listing/a/1/ or /listing/b/2

I have created the Partial router and it works. However this routing broken the BVN 404. The 404 stopped working after this routing. Basic routing didn't worked for the multiple parameters. Is there any alternative or any sample solution to achieve multiple parameters?

Regards

Raja

#185036
Edited, Nov 08, 2017 16:04
Vote:
 

Found the solution. Remove the {controller} from the route registration solved the problem

RouteTable.Routes.MapContentRoute(
"listing",
"{language}/{node}/{action}/{category}/{id}",
new
{
controller = "ListingPage",
action = "Index",
category = UrlParameter.Optional,
id = UrlParameter.Optional
});

Regards,

Raja

#185041
Nov 08, 2017 16:34
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.