473,473 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dotnet path symbol

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
3 1577
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
delete the '~\ ' from begin of your address line

Apr 26 '07 #3
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Thomas Heller | last post by:
I was trying to track down a bug in py2exe where the executable did not work when it is in a directory containing japanese characters. Then, I discovered that part of the problem is in the...
0
by: Bill Bowling | last post by:
I have a solution in VC++ dotNet that has two projects that both get built at the same time. Both are set the same in the Project Properties dialog in terms of browser file creation. One project gets...
7
by: Rizaan Jappie | last post by:
is it possible to get the relative path based on a absolute path in c#? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
4
by: Peter Hemmingsen | last post by:
Hi, I have a dotnet object (implemented in mc++ and used in c#) which have a property called "Info". The Info property is also a dotnet object (implemented in mc++). In the constructor of the...
1
by: Steve | last post by:
Hi all, I am referring to this article in MSDN : http://msdn.microsoft.com/library/en-us/secauthn/security/logonuser.asp While creating folder on the remote machine, we are specifying the UNC...
6
by: varkey.mathew | last post by:
Dear all, Bear with me, a poor newbie(atleast in AD).. I have to authenticate a user ID and password for a user as a valid Active Directory user or not. I have created the IsAuthenticated...
2
by: dave6502 | last post by:
Struggling newbe here, some of my #includes work, some dont. Is it possible to list the include path ? (in BASH), I have looked at the environmental variables (loads of them) but cannot find a...
18
by: Aaron Gray | last post by:
Has anyone got a code snippet to separate out the path components, ie drive, path, filename, and extension ? Many thanks in advance, Aaron
8
by: Derek Hart | last post by:
I am unclear about what all the requirements are to call a simple vb.net application, installed in the GAC, from COM (such as writing vba in Word to call the dotnet dll). I believe I have...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.