473,581 Members | 6,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
Nov 17 '05 #1
2 4219
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" <go****@vandevu urst.com> wrote in message
news:56******** *************** **@posting.goog le.com...
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

Nov 17 '05 #2
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" <je******@hotma il.com> wrote in message
news:#O******** ******@TK2MSFTN GP10.phx.gbl...
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" <go****@vandevu urst.com> wrote in message
news:56******** *************** **@posting.goog le.com...
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


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2414
by: Purple Haze | last post by:
I have seen websites that use a sort of "virtual directory" system... Lets say when you click on something it goes to http://www.example.com/scripts/php/ Neither the scripts directory nor the php directory physically exisit on the server, does anyone know how this is done?
13
2568
by: Bryan Harrington | last post by:
Hello all.. I'm working on an application that I'd like to use some shared files. Right now my directory structure is: / (root) .../Shared/ .../Reports/ .../Tools/
6
4809
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms Authentication set up and it worked just fine. Then I realized that I needed to have some pages unsecure. I then created 2 directories. One named Secure and...
4
4149
by: Rob | last post by:
I have a web project that has multiple directories. Some of the files in different directories use the same include files. The problem is that these include files also reference an image folder. I am trying to create an absolute reference to these images so I don't have to make the same include for different directories. What is the best...
5
3662
by: Leszek | last post by:
Hello, Could anybody explain what's a difference between a virtual directory and an application root under IIS? I'm a little bit confused. This is mu problem: Let's assume the following directory structure: FileManager (application name a.k.a. virtual directory?)
3
3133
by: Bob Peek | last post by:
I would like to share code between several web sites that exist as virtual directories under a single site. It appears that I have to create an app_code directory under each virtual root in order to share classes accross the code in the different virtual directories. This seems to defeat the purpose of shared code. Is there any way to...
1
1854
by: Frank Miverk | last post by:
Hi, I have a situation which I think is fairly common. 1. Public area 2. Secure area accessed via SSL e.g. MyWebsite/ /MySecureWebsite
6
2140
by: greek_bill | last post by:
Hi, I'm interested in developing an application that needs to run on more than one operating system. Naturally, a lot of the code will be shared between the various OSs, with OS specific functionality being kept separate. I've been going over the various approaches I could follow in order to implement the OS-specific functionality. The...
21
34372
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most obvious of which is the sharing of files. For example, you upload images to a server to share them with other people over the Internet. Perl comes ready...
0
8296
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7880
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8157
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5665
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5350
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3794
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3807
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1394
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1119
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.