virtual directory reference

  • Thread starter Thread starter Jeremy
  • Start date Start date
J

Jeremy

How do I programatically get a reference to the server directory where the
aspx form resides ? eg. "C:\inetpub\wwwroot\myApp". I want to generate some
xml cache files in there, or is this not the best place to put such files ?
 
use Server.MapPath("~") to an absolute path to the root
directory of your web application, or Server.MapPath
("~/YourFile.xml") to get the path with your file name at
the end.
 
Back
Top