ASP.NET

  • Thread starter Thread starter GTi
  • Start date Start date
G

GTi

What is the (static) function for retrieving the physical disk location
on the web page?
I need to put images on the local disk so these files are available on
the URL.
 
Hi

Look at MapPath(). There is couple of ways you can access this methods the
easiest I believe is the member of the Page class.


HTH
Stoitcho Goutsev (100) [C# MVP]
 
But the return value are wrong!
I have created a virtual directory where my "site" is located.

C.\winprog\asp\testpage <- ROOT
http://localhost/tespage <- URL

But MapPath("\images") returns
c:\inetpub\wwwroot\images

Bug?
Where?
 
You should use either
MapPath(".\images")
or
MapPath("~\images")
 
Back
Top