~ explication

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vantroeyen

    #1

    ~ explication

    Hello,

    What is the meaning of the ~ caracter in a Url

    ex: "~/folder/..." ?

    Regards
  • Bruno Jouhier [MVP]

    #2
    Re: ~ explication

    ~ is the home directory on Unix.

    I don't really know what it can mean in a URL, though (which user?)

    Bruno.

    "Vantroeyen " <N.o.S_PA_m.web master@axilog.f r> a écrit dans le message de
    news:023601c36c b3$1474f1a0$a10 1280a@phx.gbl.. .[color=blue]
    > Hello,
    >
    > What is the meaning of the ~ caracter in a Url
    >
    > ex: "~/folder/..." ?
    >
    > Regards[/color]


    Comment

    • Dominique Kuster

      #3
      Re: ~ explication

      "Vantroeyen " <N.o.S_PA_m.web master@axilog.f r> wrote in message
      news:023601c36c b3$1474f1a0$a10 1280a@phx.gbl.. .[color=blue]
      > Hello,
      >
      > What is the meaning of the ~ caracter in a Url
      >
      > ex: "~/folder/..." ?
      >[/color]
      In the context of an ASP.NET application ~ stands for the application
      directory and most properties and methods using url will replace ~ with the
      application root virtual path during rendering. This is very useful if you
      want to reference a ressource without knowing the name of the application
      directory.

      Instead of writing urls like:
      /myapp/images/ok.gif -> that could fail if myapp is once moved to
      /allapps/myapp...
      /images/ok.gif -> same problem
      .../../images/ok.gif -> relative urls not always accepted and problems if the
      owner page is moved

      You would write :
      ~/images/ok.gif

      I have tested this kind of urls for :
      HttpResponse.Re direct
      Hyperlink.Image Url, HyperLink.Navig ateUrl
      Image.ImageUrl

      But I could not manage to find a proper documentation on this behaviour.

      Hope it helps.
      DK

      Comment

      Working...