in asp.net mvc is it possible to register routes somewhere other than application.Start()
Posted
by joe q.
on Stack Overflow
See other posts from Stack Overflow
or by joe q.
Published on 2010-04-01T03:15:37Z
Indexed on
2010/04/01
3:23 UTC
Read the original article
Hit count: 278
asp.net-mvc
|routing
Hi,
is it possible to create and register routes after Application.Start() is called?
let's say have a controller, PersonController. With default routing, URLs could look something like www.site.com/Person/Edit/4, with 'Person' matching the controller.
now imagine I have several users, some may prefer we use the term 'Friends'. I would like to use the same controller, and have /Friends/Edit/4 map to the same controller/action/id. Maybe someone else prefers /Comrades/Edit/4.
with the naming preferences stored in a database, is there a way that I can dynamically create these routes at some point mid-application, after the user has logged in?
thanks!
© Stack Overflow or respective owner