469,964 Members | 1,681 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

Developing multiple applications

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
Nov 19 '05 #1
10 1203
Adrian,

Try this:

<img src="~/images/image1.gif" runat="server">

--
Tu-Thach
"Adrian" wrote:
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

Nov 19 '05 #2
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

"Adrian" <Ad****@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.com...
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

Nov 19 '05 #3
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.

"Adrian" wrote:
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

Nov 19 '05 #4
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.

"Adrian" wrote:
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

Nov 19 '05 #5
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...
======================

"Adrian" <Ad****@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.com...
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

Nov 19 '05 #6
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...
======================

"Adrian" <Ad****@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.com...
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

Nov 19 '05 #7
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

"Juan T. Llibre" wrote:
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...
======================

"Adrian" <Ad****@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.com...
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


Nov 19 '05 #8
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

"Juan T. Llibre" wrote:
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...
======================

"Adrian" <Ad****@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.com...
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


Nov 19 '05 #9
heh, heh...

I hope I see your reply.

;-)

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Adrian" <Ad****@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
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 "Juan T. Llibre" wrote:
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...
======================

"Adrian" <Ad****@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.com...
>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


Nov 19 '05 #10
heh, heh...

I hope I see your reply.

;-)

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Adrian" <Ad****@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
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 "Juan T. Llibre" wrote:
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...
======================

"Adrian" <Ad****@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.com...
>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


Nov 19 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Shikari Shambu | last post: by
2 posts views Thread by Adrian | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.