Professional Web Applications Themes

Using virtual directories for common directories (scripts, images, styles, etc.) - ASP.NET General

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 ...

  1. #1

    Default 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
    Jeffry van de Vuurst Guest

  2. #2

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

    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" <googlevandevuurst.com> wrote in message
    news:5640b2ed.0307300403.e78527aposting.google.co 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

    Jerry III Guest

  3. #3

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

    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" <jerryiiihotmail.com> wrote in message
    news:#Osd8DsVDHA.2344TK2MSFTNGP10.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" <googlevandevuurst.com> wrote in message
    > news:5640b2ed.0307300403.e78527aposting.google.co 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
    >
    >

    Jeffry van de Vuurst Guest

Similar Threads

  1. Windows IIS virtual directories
    By Tom Benjamin in forum Macromedia Contribute General Discussion
    Replies: 0
    Last Post: June 13th, 09:14 PM
  2. No JRunScripts virtual directories (?)
    By Bill Gordon in forum Coldfusion - Getting Started
    Replies: 5
    Last Post: June 9th, 08:05 PM
  3. Virtual Directories?
    By Purple Haze in forum PHP Development
    Replies: 4
    Last Post: September 29th, 02:36 PM
  4. virtual directories and IIS
    By Ali in forum ASP.NET Web Services
    Replies: 1
    Last Post: November 26th, 04:52 AM
  5. Virtual Directories and ASP Session Var
    By Mark Schupp in forum ASP
    Replies: 12
    Last Post: October 2nd, 08:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139