Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Does anybody have a clean way to manage relative links in an application that has various levels of directories?

 

I'd like to ....

 

1. Keep all of the my images in applicationroot/images and be able to get to them easily no matter how deep I am in the application (deep meaning directory level).

 

2. Keep my application code in different applicationroot/modules/modulename directories and be able to navigate easily between them.

Posted

Thanks for the response... albeit short ;)

 

That does not work for example if I am on page directory/herethere.aspx and it has a link to /directory/herethere.aspx. What you get is the application trying to go to /directory/directory/herethere.aspx. The "/" is usually relative to the directory the current page is in if I am not mistaken.

 

One of the things I am testing right now is "~/directory/herethere.aspx"

Posted

"/" takes you up to the web site or virtual directory root.

 

so if you are in "directory/page.aspx" and you link to yourself, then your link should be "page.aspx" or "/directory/page.aspx"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...