Re: Server.MapPath & Request.MapPath



Hello rn5a@xxxxxxxxxxxxxx,

There are no difference in this aspect, because the Server.MapPath calls the _context.Request.MapPath(path)
inside its method

---
WBR, Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we miss it, but that it is too low and we reach it" (c) Michelangelo


Server.MapPath returns the physical file path that corresponds to the
specified virtual path whereas Request.MapPath maps the specified
virtual path to a physical path. Assuming that a file named Hello.aspx
resides in C:\Inetpub\wwwroot\MyFolder, the output of both

Response.Write(Server.MapPath("Hello.aspx"))

&

Response.Write(Request.MapPath("Hello.aspx"))

is C:\Inetpub\wwwroot\MyFolder\Hello.aspx. So what's the difference
between Server.MapPath & Request.MapPath?

Thanks



.



Relevant Pages

  • Server.MapPath & Request.MapPath
    ... Server.MapPath returns the physical file path that corresponds to the ... specified virtual path whereas Request.MapPath maps the specified ...
    (microsoft.public.dotnet.framework.aspnet)
  • How get the virtual path based on the physical path?
    ... Server.MapPathreturns the physical file path based on ... the specified virtual path. ... Is there any reverse method to get the ... virtual path based on the physical path (both pathes belong to the ...
    (microsoft.public.dotnet.framework.aspnet)