Developing multiple applications

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a really newbie question... I developed an asp.net application. By
default, it was created here:

c:\inetpub\wwwroot\

Now, I wanted to create another application, completely independent. I
placed it here:

c:\inetpub\wwwroot\testapp\

The problem is that now, in the second application any reference to "/"
doesn't refer to the root of the second application, as I would expect, but
to the root of the main application... For instance if I have this:

<img src="/images/image1.gif">

I would expect this to point to: c:\inetpub\wwwroot\testapp\images\image1.gif
Instead, it points to:
c:\inetpub\wwwroot\images\image1.gif

Obviously, I could write all my links to include the testapp subdir, but the
reality is that the second application will be deployed on it's own server
and therefore over there it will point to the root. So, I cannot find a way
to develop this on the same machine... Am I missing something?
As a workaround I defined a key in the web.config and I put in there a
"suffix" which I apply to all links and on the developlement machine is
"/testapp" and on the production server it is ""... But really, I should be
able to develop 2 independent applications on the same machine....

Any help would be appreciated,

Thank you,
Adrian
 
Either develop on a test server so that you can have multiple sites defined
in IIS and don't have to worry about this, or when you're working on this
site, set that physical directory to be the root of your site in IIS and
switch to the other one when you're working on that.

Ray at work
 
try this out "../images/image1.gif"

Create folder structure like this and use above path.

C:\inetpub\wwwroot\
Testapp1 folder
images
css
js

Testapp2 folder
images
css
js
Let me know if it doesn't works out.
 
You've been given a couple of suggestions.

The real answer, however, is that you shouldn't
create an application in the root directory.

*All* applications should be located in subdirectories of the
root directory, which should *never* be an application itself.

That way, using
<img src="/images/image1.gif">
would work in *all* applications, because there
wouldn't be a reference below any application's directory.





Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
 
Hmm... Thanks, this seems to make a lot of sense... Ok, I will do a suicidal
attempt and move the app 1 in its own dir and cancel the application at the
root level. If I never reply it means it didn't work and I jumped out the
window :-) I'm kidding, I will backup first...

Thanks again!!
Adrian
 

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

Back
Top