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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top