Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Using virtual directories for common directories (scripts, images, styles, etc.)

Reply
Thread Tools

Using virtual directories for common directories (scripts, images, styles, etc.)

 
 
Jeffry van de Vuurst
Guest
Posts: n/a
 
      07-30-2003
Hi,

(sorry for the crosspost, I wasn't sure which was the best place to
put this).

I was just thinking about something and wondered if any of you has
some ideas about this.

I'm using the NetAdvantage component suite from Infragistics for my
web applications. When installing they create several virtual
directories for the scripts and images directories that their
components use. That way e.g., when you drop a control on a form, and
the imagedirectory property is by default set to /ig_images/ it
automatically finds the images, no matter where the webform is located
in the hierarchy of the website.

I find this a clever idea. I've never done this and never seen a
website that does this, but it sounds like a good idea.

I mean, I have a web application with several subdirectories, user
controls, script/style/images directories etc. etc. It seems like a
good idea to turn my images, scripts, styles directories into virtual
directories, so that I can access them from anywhere within my web
application with simply the virtual directory name, not having to
worry anymore about those relative paths (../../).

I know about the "~" to access the virtual root, but I've had some
problems with that, especially when the web application is not in a
virtual directory but in its own website.

To make it short, it seems like all advantages, but are there any
disadvantages?

Thanks,
Jeffry
 
Reply With Quote
 
 
 
 
Jerry III
Guest
Posts: n/a
 
      07-30-2003
Virtual directory only means that the directory doesn't physically reside
under the application's directory. Your server side code could care less
whether a directory is virtual or not. So no, it's not a clever idea as a
virtual directory /style is referenced exactly the same way as real
directory /style.

What kind of problems did you have using ~/path? Remember that you need to
call ResolveUrl("~/path") in places where that's not called automatically...

Jerry

"Jeffry van de Vuurst" <> wrote in message
news: m...
> Hi,
>
> (sorry for the crosspost, I wasn't sure which was the best place to
> put this).
>
> I was just thinking about something and wondered if any of you has
> some ideas about this.
>
> I'm using the NetAdvantage component suite from Infragistics for my
> web applications. When installing they create several virtual
> directories for the scripts and images directories that their
> components use. That way e.g., when you drop a control on a form, and
> the imagedirectory property is by default set to /ig_images/ it
> automatically finds the images, no matter where the webform is located
> in the hierarchy of the website.
>
> I find this a clever idea. I've never done this and never seen a
> website that does this, but it sounds like a good idea.
>
> I mean, I have a web application with several subdirectories, user
> controls, script/style/images directories etc. etc. It seems like a
> good idea to turn my images, scripts, styles directories into virtual
> directories, so that I can access them from anywhere within my web
> application with simply the virtual directory name, not having to
> worry anymore about those relative paths (../../).
>
> I know about the "~" to access the virtual root, but I've had some
> problems with that, especially when the web application is not in a
> virtual directory but in its own website.
>
> To make it short, it seems like all advantages, but are there any
> disadvantages?
>
> Thanks,
> Jeffry



 
Reply With Quote
 
 
 
 
Jeffry van de Vuurst
Guest
Posts: n/a
 
      07-30-2003
Hmmm, you've got a point there. I guess I was a bit confused because I'm
used to developing my sites in virtual directories inside my Default Web
Site. That way you always have to work from the virtual root and you cannot
simply say /style, but you'd have to say /website1/style or something like
that.

Now that I'm using separate IIS websites for every site, I simply can use
/style.

I didn't know about ResolveUrl(), I'll take a look at that.

Thanks for your information.

Regards,
Jeffry

"Jerry III" <> wrote in message
news:#...
> Virtual directory only means that the directory doesn't physically reside
> under the application's directory. Your server side code could care less
> whether a directory is virtual or not. So no, it's not a clever idea as a
> virtual directory /style is referenced exactly the same way as real
> directory /style.
>
> What kind of problems did you have using ~/path? Remember that you need to
> call ResolveUrl("~/path") in places where that's not called

automatically...
>
> Jerry
>
> "Jeffry van de Vuurst" <> wrote in message
> news: m...
> > Hi,
> >
> > (sorry for the crosspost, I wasn't sure which was the best place to
> > put this).
> >
> > I was just thinking about something and wondered if any of you has
> > some ideas about this.
> >
> > I'm using the NetAdvantage component suite from Infragistics for my
> > web applications. When installing they create several virtual
> > directories for the scripts and images directories that their
> > components use. That way e.g., when you drop a control on a form, and
> > the imagedirectory property is by default set to /ig_images/ it
> > automatically finds the images, no matter where the webform is located
> > in the hierarchy of the website.
> >
> > I find this a clever idea. I've never done this and never seen a
> > website that does this, but it sounds like a good idea.
> >
> > I mean, I have a web application with several subdirectories, user
> > controls, script/style/images directories etc. etc. It seems like a
> > good idea to turn my images, scripts, styles directories into virtual
> > directories, so that I can access them from anywhere within my web
> > application with simply the virtual directory name, not having to
> > worry anymore about those relative paths (../../).
> >
> > I know about the "~" to access the virtual root, but I've had some
> > problems with that, especially when the web application is not in a
> > virtual directory but in its own website.
> >
> > To make it short, it seems like all advantages, but are there any
> > disadvantages?
> >
> > Thanks,
> > Jeffry

>
>



 
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
Can *common* struct-members of 2 different struct-types, that are thesame for the first common members, be accessed via pointer cast to either struct-type? John Reye C Programming 28 05-08-2012 12:24 AM
Virtual Directories and Physical directories Paul M Fin MCAD 4 06-27-2008 07:50 PM
virtual directories/physical directories in IIS Paul F ASP .Net 4 06-25-2008 04:04 PM
java.lang.NoSuchMethodError: wm.common.session.Common.getCustRptListFromMax Denny Java 1 05-01-2008 07:33 AM
Multiple bin-directories with virtual directories? =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?= ASP .Net 0 11-09-2004 05:49 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57