Back Story
I am currently updating an existing web application to support a multi-tenant environment. Today we current host an application on http://www.example.com/MyApp, but now we must be able to support multiple clients on the same web application.
So each client should be able to access the application through urls like:
http://www.example.com/MyApp/Client1
http://www.example.com/MyApp/Client2
The web application is an ASP.NET webforms app that we are also upgrading to use .NET 4. I have already implemented the new routing available in ASP.NET 4, and I haven already put the appropriate routes in place to support the multi-tenant architecture.
The example URL http://www.example.com/MyApp/Client1/SomeModule/SomePage.aspx will route to and execute /MyApp/SomeModule/SomePage.aspx
and I have access to the client part from within the RouteData.
BUT...
Main Question:
We have links in many parts of the application that use url's like ~/SomeModule/SomePage.aspx
, so when they render out to the browser they will still show /MyApp/SomeModule/SomePage.aspx
, but what I really want is to have it contain one of my route values to inject the client page like MyApp/Client1/SomeModule/SomePage.aspsx
Is there a way to override what the ~/
means throughout my application without going through my entire app and updating the links?