analog of .NET Request.ApplicationPath

Discussion in 'ASP General' started by Vadym Stetsyak, May 20, 2005.

  1. Vadym Stetsyak, May 20, 2005
    #1
    1. Advertising

  2. Vadym Stetsyak wrote:
    > Hi, All!
    >
    > For example if I have
    > http://server/myvirtualpath/someotherpath/page.asp
    >
    > and virtual path on the IIS is http://server/myvirtualpath
    >
    > How can I retrieve above mentioned asp application path. I need the
    > same functionality that has ASP.NET (Request.ApplicationPath)
    >

    Use Server.MapPath

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], May 20, 2005
    #2
    1. Advertising

  3. Server.MapPath - it maps relative or virtual path to the physical path.
    I need something else, I want to obtain virtual root path, like /myapp

    In asp.net Request.ApplicationPath - gives the application's virtual
    application root path on the server. This is the kind of functionality I
    need in the asp

    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > Vadym Stetsyak wrote:
    > > Hi, All!
    > >
    > > For example if I have
    > > http://server/myvirtualpath/someotherpath/page.asp
    > >
    > > and virtual path on the IIS is http://server/myvirtualpath
    > >
    > > How can I retrieve above mentioned asp application path. I need the
    > > same functionality that has ASP.NET (Request.ApplicationPath)
    > >

    > Use Server.MapPath
    >
    > Bob Barrows
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >
    Vadym Stetsyak, May 20, 2005
    #3
  4. By using "/myapp" you have confused the issue. "myapp" appears nowhere in
    the example you originally provided.

    I was under the impression that ApplicationPath was equivalent to physical
    path. It seems I was mistaken. Given the virtual paths you descibed
    originally what do you wish to retrieve?

    http://server/virtualpath ?
    /virtualpath ?

    I just looked it up: "Gets the ASP.NET application's virtual application
    root path on the server."

    So it appears you wish to obtain /virtualpath, correct?

    There is nothing builtin for this. You will need to parse one of the
    following servervariables:

    APPL_MD_PATH
    PATH_INFO
    SCRIPT_NAME
    URL

    Bob Barrows

    Vadym Stetsyak wrote:
    > Server.MapPath - it maps relative or virtual path to the physical
    > path. I need something else, I want to obtain virtual root path, like
    > /myapp
    >
    > In asp.net Request.ApplicationPath - gives the application's virtual
    > application root path on the server. This is the kind of
    > functionality I need in the asp
    >
    > "Bob Barrows [MVP]" <> wrote in message
    > news:...
    >> Vadym Stetsyak wrote:
    >>> Hi, All!
    >>>
    >>> For example if I have
    >>> http://server/myvirtualpath/someotherpath/page.asp
    >>>
    >>> and virtual path on the IIS is http://server/myvirtualpath
    >>>
    >>> How can I retrieve above mentioned asp application path. I need the
    >>> same functionality that has ASP.NET (Request.ApplicationPath)
    >>>

    >> Use Server.MapPath
    >>

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], May 20, 2005
    #4
  5. Vadym Stetsyak

    Patrice Guest

    AFAIK this is new in ASP.NET.

    In ASP you don't have this information readily available. IMO you could wrap
    this in a function that :
    - calls Server.RequestVariables("APPL_PHYSICAL_PATH")
    - use server.MapPath("/") to get the web site root

    On Friday I'll avoid to exhaust my last neural resources but from there you
    should be able to extract the virtual path (get those appl_physical_path
    chars that exceed the MapPath("/") etc...)

    Zzzzzzzz....

    Patrice

    --

    "Vadym Stetsyak" <> a écrit dans le message de
    news:...
    > Server.MapPath - it maps relative or virtual path to the physical path.
    > I need something else, I want to obtain virtual root path, like /myapp
    >
    > In asp.net Request.ApplicationPath - gives the application's virtual
    > application root path on the server. This is the kind of functionality I
    > need in the asp
    >
    > "Bob Barrows [MVP]" <> wrote in message
    > news:...
    > > Vadym Stetsyak wrote:
    > > > Hi, All!
    > > >
    > > > For example if I have
    > > > http://server/myvirtualpath/someotherpath/page.asp
    > > >
    > > > and virtual path on the IIS is http://server/myvirtualpath
    > > >
    > > > How can I retrieve above mentioned asp application path. I need the
    > > > same functionality that has ASP.NET (Request.ApplicationPath)
    > > >

    > > Use Server.MapPath
    > >
    > > Bob Barrows
    > > --
    > > Microsoft MVP - ASP/ASP.NET
    > > Please reply to the newsgroup. This email account is my spam trap so I
    > > don't check it very often. If you must reply off-line, then remove the
    > > "NO SPAM"
    > >
    > >

    >
    >
    Patrice, May 20, 2005
    #5
  6. Yes, you're correct, I want /virtualpath

    As my web app is a combination of asp and asp.net I think that asp.net part
    will tell asp part what is its virtual path ::cool:

    imho it will be better than parsing...

    "Bob Barrows [MVP]" <> wrote in message
    news:#...
    > By using "/myapp" you have confused the issue. "myapp" appears nowhere in
    > the example you originally provided.
    >
    > I was under the impression that ApplicationPath was equivalent to physical
    > path. It seems I was mistaken. Given the virtual paths you descibed
    > originally what do you wish to retrieve?
    >
    > http://server/virtualpath ?
    > /virtualpath ?
    >
    > I just looked it up: "Gets the ASP.NET application's virtual application
    > root path on the server."
    >
    > So it appears you wish to obtain /virtualpath, correct?
    >
    > There is nothing builtin for this. You will need to parse one of the
    > following servervariables:
    >
    > APPL_MD_PATH
    > PATH_INFO
    > SCRIPT_NAME
    > URL
    >
    > Bob Barrows
    >
    > Vadym Stetsyak wrote:
    > > Server.MapPath - it maps relative or virtual path to the physical
    > > path. I need something else, I want to obtain virtual root path, like
    > > /myapp
    > >
    > > In asp.net Request.ApplicationPath - gives the application's virtual
    > > application root path on the server. This is the kind of
    > > functionality I need in the asp
    > >
    > > "Bob Barrows [MVP]" <> wrote in message
    > > news:...
    > >> Vadym Stetsyak wrote:
    > >>> Hi, All!
    > >>>
    > >>> For example if I have
    > >>> http://server/myvirtualpath/someotherpath/page.asp
    > >>>
    > >>> and virtual path on the IIS is http://server/myvirtualpath
    > >>>
    > >>> How can I retrieve above mentioned asp application path. I need the
    > >>> same functionality that has ASP.NET (Request.ApplicationPath)
    > >>>
    > >> Use Server.MapPath
    > >>

    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >
    Vadym Stetsyak, May 20, 2005
    #6
    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. Jim Corey
    Replies:
    0
    Views:
    934
    Jim Corey
    Nov 21, 2003
  2. martin

    request.applicationpath

    martin, Jan 8, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    4,605
    martin
    Jan 8, 2004
  3. Kent P. Iler
    Replies:
    0
    Views:
    389
    Kent P. Iler
    Oct 12, 2004
  4. Ponnurangam

    Request.ApplicationPath

    Ponnurangam, Mar 15, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    571
  5. James
    Replies:
    1
    Views:
    628
    Karl Seguin [MVP]
    Nov 1, 2006
Loading...

Share This Page