Add custom routes outside from Global.asax | Episerver Developer Community

Add custom routes outside from Global.asax

Member since: 2011



I'm wondering is there any place to hook some event handler or something to add custom routes to route table if I'm not able to do that in Global.asax (custom route must be added in 3rd party package). I realized that during initializable module - it's too early, as module initialization is done before default routes are regsitered.

Sort of workaround I found using dynamically registered http module that is invoked during requests and adding custom route there.

Just wanted to confirm that there is not other way around or I'm missing something..

#71041 May 08, 2013 0:16
  • Member since: 2004

    I have reported a bug that we should add pre and post events around Route registration.

    You can add your custom routes in an initializable module but as you say it will be called before the default CMS routes are registered meaning the custom routes will be before the CMS routes in the table.

    So if you need to have your routes after the builtin one for now one option is as you say to have a IHttpModule that register routes in the Init method. 

    #71042 May 08, 2013 7:26
  • Member since: 2011

    Thanks, at least I know that this is not possible yet.

    #71044 May 08, 2013 8:47
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
Please login to post a reply