473,396 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1323
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tina | last post by:
Hello, I'm currently preparing for the exam 70-315. I'm using the Self-paced training kit "Developing Web Applications with Microsoft Visual C#.NET", but I find it rather difficult. I have...
3
by: Shikari Shambu | last post by:
Hi All, I have a situation where multiple applications are sharing some pages/ controls. So, I have a separate common project that has the common pages/ controls. My question is how do I...
2
by: Adrian | last post by:
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....
1
by: Peter | last post by:
I have written several programs that need to run on different schedules. The schedules consist of multiple business rules. Until yesterday I was scheduling most of these applications through the...
8
by: mc | last post by:
I would like to host two websites on my brinkster developer account. I have configured the multiple applications and they both work fine, they can be access at: - myalias.brinkster.net/site1 ...
0
by: Dutt | last post by:
Writing/Developing Facebook Applications in .NET using Facebook.NET SDK http://msdotnetsupport.blogspot.com/2007/11/writing-facebook-applications-in-net.html
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.