I use this function:
I find it easier to wrap this up in a function for maintenance , debugging
and consistency issues.
Its probably a little overkill, but I'm come to trust it, for than random
MapPaths all over the place.
public static string FindPhysicalRoo tDirectory(Page p)
{
string rootDir;
rootDir = p.Server.MapPat h("~/");
return rootDir;
}
Public Shared Function FindPhysicalRoo tDirectory(ByVa l p As Page) As
String
Dim rootDir As String
rootDir = p.Server.MapPat h("~/")
Return rootDir
End Function
I have another counter part:
public static string FindVirtualRoot Directory(Page p)
{
return "~/";
}
It seems to work.
Remember , in 2.0 remember to test against IIS deployment and the casino web
server deployment. (the local non iis port-number deployment)
If you wait to test IIS until deployment, you may be surprised it doesn't
work.
"dgk" <No*****@MailsA nonymous.comwro te in message
news:rp******** *************** *********@4ax.c om...
I have a few text files that I read in at run time into label
controls; they're stored in a Text folder in the app. At run time I
try to read them in by using "~/text/thefile.txt" but it doesn't work
in the editor or when published. I've tried a few appgetpath type
things and can't get one to work.
Any help greatly appreciated.