virtual directory reference

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 ?
 
J

Jon Paugh

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.
 

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

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top