ASP / ASP.Net server.mappath

M

Mark Horrocks

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
 
K

Kevin Spencer

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

Mark

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
 
K

Kevin Spencer

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

Kevin Spencer

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top