Re: Best way to use a header include file?

Discussion in 'ASP .Net' started by Alan Silver, Sep 27, 2005.

  1. Alan Silver

    Alan Silver Guest

    If the images are all in /images, then why bother with the ~ sign?
    That's only for server controls anyway, so you have to remember to use /
    in client stuff.

    It would be easier to use /images for everything, as that will always
    resolve to the images folder off the domain's root. No?

    >> "~/images/whatever.ext" will work for any application folder.
    >>
    >> "~" stand for the application root in ASP.NET,
    >> so if you have a directory structure like this :
    >>
    >> root
    >> /images
    >> /anotherdir
    >> /anotherdir/someotherdir
    >> /anotherdir/someotherdir/yetanotherdir
    >>
    >> "~/images/whatever.ext" will reference root/images
    >> from all those directories.

    >
    >
    >Thanks. Where is this mentioned in the help file or MSDN? I don't even know
    >what keyword to use for this.
    >
    >John
    >
    >
    >
    >>
    >>
    >>
    >> Juan T. Llibre, ASP.NET MVP
    >> ASP.NET FAQ : http://asp.net.do/faq/
    >> Foros de ASP.NET en EspaƱol : http://asp.net.do/foros/
    >> ======================================
    >> "John Dalberg" <2> wrote in message
    >> news:1pmdxncbz8pf9$...
    >>>
    >>>
    >>> I created a header file to be included in every webpage. The header file
    >>> has images that have a path to an "images" folder off the root folder.
    >>> However if I use this header file for web pages that reside in subfolders,
    >>> I have to change the path of all the image links to '../images/' instead of
    >>> 'images/'.
    >>>
    >>> What's the best way to have a single header file which *any* web page,
    >>> regardless of its location, can use without modifying it to suit certain
    >>> webpages depedning on their location?
    >>>
    >>> --
    >>> John Dalberg


    --
    Alan Silver
    (anything added below this line is nothing to do with me)
    Alan Silver, Sep 27, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Dalberg
    Replies:
    2
    Views:
    417
    boclair
    Sep 20, 2005
  2. Aguilar, James
    Replies:
    2
    Views:
    676
    Aguilar, James
    Jul 16, 2004
  3. Victor Bazarov

    #include "file" -vs- #include <file>

    Victor Bazarov, Mar 5, 2005, in forum: C++
    Replies:
    4
    Views:
    525
    Exits Funnel
    Mar 6, 2005
  4. Andreas Bogenberger
    Replies:
    3
    Views:
    888
    Andreas Bogenberger
    Feb 22, 2008
  5. mlt
    Replies:
    2
    Views:
    820
    Jean-Marc Bourguet
    Jan 31, 2009
Loading...

Share This Page