Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Developing multiple applications

Reply
Thread Tools

Developing multiple applications

 
 
=?Utf-8?B?QWRyaWFu?=
Guest
Posts: n/a
 
      07-25-2005
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VHUtVGhhY2g=?=
Guest
Posts: n/a
 
      07-25-2005
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

 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      07-25-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
=?Utf-8?B?SEFSSSBQUkFTRCBCQVJV?=
Guest
Posts: n/a
 
      07-25-2005
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

 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      07-25-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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



 
Reply With Quote
 
=?Utf-8?B?QWRyaWFu?=
Guest
Posts: n/a
 
      07-25-2005
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >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

>
>
>

 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      07-25-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> >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

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple applications/multiple web.configs: how to structure a big collection of (seemingly) nested web applications? ASP .Net 3 06-14-2007 09:25 AM
Developing applications for Cisco routers onestatusquo@yahoo.com Cisco 6 06-03-2005 09:24 PM
Exam 70-315: Developing Web Applications with Visual C#.NET =?Utf-8?B?VGluYQ==?= ASP .Net 2 11-04-2004 06:42 PM
Developing applications for Palm/PPC/Symbian?! What enviroment? Pret Orian Java 1 05-25-2004 08:07 PM
Richard Grimes' book "Developing Applications With Visual Studio.NET" Andy Turner ASP .Net 6 11-03-2003 02:19 PM



Advertisments