ASP / ASP.Net server.mappath

Discussion in 'ASP .Net' started by Mark Horrocks, Sep 1, 2004.

  1. Hi,
    Whilst trying to solve another problem (see my post yesterday please!)
    I have come across something strange.
    I created an ASP version and an ASPX version of the same code, and ran
    it in the same folder, ie:
    http://x.y.z/code/test.asp and http://x.y.z/code/test.aspx
    I use code in front as i can't get code behind working on my server
    (see previous post please!)

    The script simply uses server.mappath to output paths:
    server.mappath(".")
    server.mappath("..")
    server.mappath("/")

    the aspx version gives :
    current path \\share\folder\code (code is in a virtual defined on a
    share)
    parent path c:\inetpub\wwwroot
    root path c:\inetpub\wwwroot\

    the asp version gives
    current \\filespace2\intranet\system\code
    parent \\filespace2\intranet\system
    root c:\inetpub\wwwroot

    Note that the path returned for the parent differs significantly.

    Is this known behaviour?

    Thanks

    Mark
    Mark Horrocks, Sep 1, 2004
    #1
    1. Advertising

  2. > Is this known behaviour?

    Unless you don't know about it, yes.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Mark Horrocks" <> wrote in message
    news:...
    > Hi,
    > Whilst trying to solve another problem (see my post yesterday please!)
    > I have come across something strange.
    > I created an ASP version and an ASPX version of the same code, and ran
    > it in the same folder, ie:
    > http://x.y.z/code/test.asp and http://x.y.z/code/test.aspx
    > I use code in front as i can't get code behind working on my server
    > (see previous post please!)
    >
    > The script simply uses server.mappath to output paths:
    > server.mappath(".")
    > server.mappath("..")
    > server.mappath("/")
    >
    > the aspx version gives :
    > current path \\share\folder\code (code is in a virtual defined on a
    > share)
    > parent path c:\inetpub\wwwroot
    > root path c:\inetpub\wwwroot\
    >
    > the asp version gives
    > current \\filespace2\intranet\system\code
    > parent \\filespace2\intranet\system
    > root c:\inetpub\wwwroot
    >
    > Note that the path returned for the parent differs significantly.
    >
    > Is this known behaviour?
    >
    > Thanks
    >
    > Mark
    Kevin Spencer, Sep 1, 2004
    #2
    1. Advertising

  3. Mark Horrocks

    Mark Guest

    Hi Kevin,
    Thanks for your reply. Could you send me a reference to where this is
    described, because I can't find anything on MSDN.
    Mark





    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Mark, Sep 1, 2004
    #3
  4. Well, you just described it. Other than that, I suppose I (or you) would
    have to search for it on the Internet. However, as it is something we
    already know, I don't see any point in MY searching for it.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Mark" <> wrote in message
    news:ec$...
    > Hi Kevin,
    > Thanks for your reply. Could you send me a reference to where this is
    > described, because I can't find anything on MSDN.
    > Mark
    >
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Kevin Spencer, Sep 1, 2004
    #4
  5. Let me clarify my response, Mark: You discovered that ASP and ASP.Net return
    2 different FORMATS of the same path. Regardless of the format, both are
    valid file paths. As far as I'm concerned, it is a somewhat interesting, but
    unimportant fact, as both work. My guess would be that Microsoft decided
    that a UNC was a more "ubiquitous" way of returning the path, and modified
    ASP.Net accordingly. If and where that is documented is unimportant to me,
    as you have already told me about it, and therefore, it is already
    documented in this newsgroup, and we both already know it. I only look stuff
    up that I don't already know.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Mark" <> wrote in message
    news:ec$...
    > Hi Kevin,
    > Thanks for your reply. Could you send me a reference to where this is
    > described, because I can't find anything on MSDN.
    > Mark
    >
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Kevin Spencer, Sep 1, 2004
    #5
    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. Jon
    Replies:
    5
    Views:
    11,147
    Scott M.
    Jan 17, 2010
  2. Peter Row
    Replies:
    0
    Views:
    464
    Peter Row
    Mar 1, 2004
  3. =?Utf-8?B?dHBhcmtzNjk=?=

    server.mappath vs. request.mappath

    =?Utf-8?B?dHBhcmtzNjk=?=, Mar 10, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,145
    Juan T. Llibre
    Mar 11, 2007
  4. Replies:
    4
    Views:
    963
    Juan T. Llibre
    Oct 7, 2007
  5. AAaron123
    Replies:
    11
    Views:
    1,199
    AAaron123
    Sep 9, 2009
Loading...

Share This Page