expressiong absolute paths in aspx

D

David Cho

This is a simple issue I am trying to figure out.

How would I express absolute paths to various aspx files in the aspx
page. I am not intereted in relative paths.

For example, I want to encapsulate a HyperLink control in a user
control. Of course this user control can go anywhere vin various
subfolders, but when the link is clicked, I would like to set
NavigateUrl to a the same target page. So a rlative path won't work.
Thanks.
 
H

Hans Kesting

David said:
This is a simple issue I am trying to figure out.

How would I express absolute paths to various aspx files in the aspx
page. I am not intereted in relative paths.

For example, I want to encapsulate a HyperLink control in a user
control. Of course this user control can go anywhere vin various
subfolders, but when the link is clicked, I would like to set
NavigateUrl to a the same target page. So a rlative path won't work.
Thanks.

If you know the position of the target, relative to the root of the site,
AND that url is processed by the .net system (as in Hyperlink),
THEN you can write "root of application" as "~".
So "~/sub1/sub2/page.aspx" will always point to the same "page.aspx",
even if you move your app from development to hosting.

Hans Kesting
 
E

Eliyahu Goldin

You probably mean server side subfolders.

Anyway, an absolute path won't be accepted on server side. The servers don't
do it for security reasons.

Eliyahu
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top