Change Asp.Net app path

C

Cubaman

Hello:
Is it possible to dinamically change asp.net application path? I have
two versions of my application, and based on the request i want it to
point to one app or another. I'm thinkin in implement IHttpModule
interface, but all the path related propertys of HttpRequest are
readonly.
Thank you all,

Oscar
 
G

Guest

Why not just re-engineer a single app to make the required determination and
process the request accordingly. Simplify!
Peter
 
P

Patrice

I would even never have thought to try such a thing ;-). Keep in mind that
ASP.NET does a whole lot of things (session, viewstate, watching files,
loading assemblies, compiling dynamic code, using a application pool etc...)
that would likely make the concept of changing the "current application"
from within "your application" a non sense.

You could still perhaps use a browser redirection or make available the
required functionnaly directly in your second application for example but
IMO your best bet for now is to elaborate on the problem you are trying to
solve so that someone could perhaps suggest a possible solution...
 
R

Rick Strahl [MVP]

Nope not possible with IIS 6 and ASP.NET 2.0. Once ASP.NET has set up the
AppDomain the virtual and physical paths are fixed and cannot be changed.

Short of redirecting there's nothing you're going to be able to do to route
requests to other applications.

In IIS 7 (Vista and Longhorn Server later) you will be able to hook modules
at a lower level - basically you can look at every request in IIS and with
that you can potentially route requests to other applications if you are
checking at the root level application.


+++ Rick ---
 
C

Cubaman

I would even never have thought to try such a thing ;-). Keep in mind that
ASP.NET does a whole lot of things (session, viewstate, watching files,
loading assemblies, compiling dynamic code, using a application pool etc....)
that would likely make the concept of changing the "current application"
from within "your application" a non sense.

You could still perhaps use a browser redirection or make available the
required functionnaly directly in your second application for example but
IMO your best bet for now is to elaborate on the problem you are trying to
solve so that someone could perhaps suggest a possible solution...

Hello Patrice, thaks for your answer. I'm developing a site with two
versions, one for normal browser and other for mobiles browsers. I'd
like to have just one url, so it would be easy to remember for users,
and based on browser type, redirect users to the rigth site. If it
can't be achieved with IHttpModule, which would be the best approach?
Thanks all for you answers and support!
Oscar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top