By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,871 Members | 2,444 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,871 IT Pros & Developers. It's quick & easy.

dotnet path symbol

P: n/a
LP
Hi all,
When I choose a destination url a ~ symbol is inserted for me eg
~\apppath\abc.aspx. But when I run the aspx, it can't find the file
abc.aspx. but if I type the full pathname it can find the file eg
c:\inetpub\ccc\abc.aspx. any idea?

thanks
Apr 25 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
App path root symbol (~) is resolved to application root folder and they are
resolved only when used on server controls.

"LP" wrote:
Hi all,
When I choose a destination url a ~ symbol is inserted for me eg
~\apppath\abc.aspx. But when I run the aspx, it can't find the file
abc.aspx. but if I type the full pathname it can find the file eg
c:\inetpub\ccc\abc.aspx. any idea?

thanks
Apr 25 '07 #2

P: n/a
delete the '~\ ' from begin of your address line

Apr 26 '07 #3

P: n/a
If directing a web client, use Response.Redirect(ResolveUrl("~/abc.aspx"));

If executing the .aspx file from the server without redirecting the client,
try:
Server.Execute(ResolveUrl("~/abc.aspx"));

If accessing the .aspx file itself directly on the server, one would ask
why? I can understand this for an .xml file, but why read an .aspx directly?
At any rate, you can read files on the server using:

//myFile = "~/abc.xml"
if (myFile.StartsWith("~")) myFile = myFile.Replace("/", "\\")
.Replace("~", Request.PhysicalApplicationPath);

or,

myFile = Request.MapPath(myFile);
Jon

"LP" <lp@yahoo.comwrote in message
news:f0**********@reader01.singnet.com.sg...
Hi all,
When I choose a destination url a ~ symbol is inserted for me eg
~\apppath\abc.aspx. But when I run the aspx, it can't find the file
abc.aspx. but if I type the full pathname it can find the file eg
c:\inetpub\ccc\abc.aspx. any idea?

thanks
May 16 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.