Search code examples
asp.netasp.net-mvcasp.net-routing

Editing already defined routes


I'm working on a dynamic project which is adding or changing the route urls. For example: I want to add sub application route like AppName/{controller}/{action}/{id} or maybe a language information like {controller}/{action}/{id}/{language} in this scenario, I can't touch to other routes and I have to override them.

I tried to foreach RouteTable.Routes and there is no editable values for added routes.

Thanks for any help.


Solution

  • I found the solution. I cast the items in the RouteTable.Routes to Route object :)