What is the best way to configure this?




Env : ASP.NET 2.0 / C#

Long time ago, I developed one asp.net WebApp
This structure is..
/WebApp (Virtual Directory)
|--- Web.config
|--- Master and aspx files...

In this aspx page, I used ~ to reference the master pages.

Now, I am developing different app, but I need these same web pages into the
subfolder of OldWebApp under NewWebApp virtual directory.....like this..

/NewWebApp (Virtual Directory)
|----- Web.config
|----- OldWebApp (Folder)
|--- Copied here from above WebApp Master and ASPX page

The problem I found is that since I used ~ to reference MasterPage...,
I wasn't able to browse the OldWebApp because it tries to find the MasterPage
under NewWebApp, not the OldWebApp.

Is there any way I can configure this correctly WITHOUT modifying the source
or moving the master page to under NewWebApp?...

Maybe somehow set by web.config for the OldWebApp folder??
In that way, under OldWebApp, ~ will refer from OldWebApp folder, not
from NewWebAp...or other way?...possible?

I would like to keep these files in this structure for better maintenance,
if I can..

Hope you understand my issue.





Well...In short, my question is that...
Is there any way I can override ~ behavior in web.config?

This is one of wish examples
If I set this way in the web.config..
<location path="OldWebApp">

Something like that...This means that..
If I use ~ in any pages in the OldWebApp folder, the root will be from
OldWebApp folder, NOT the root of the web application.....

Any possible way to do this?


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