Link to home
Start Free TrialLog in
Avatar of Lorna70
Lorna70

asked on

URLs - relative and the use of ~

Hi I have a file (control) at the root of my website called topbar.ascx which holds all my navigation buttons.  The problem is I have sub-folders which also include this control on their pages.  Therefore, how do I reference a url from outside and inside a sub-folder?  I was advised to use ~.  So in my topbar.ascx I have <li><a href="~/blog/default.aspx">Blog</a></li> which you would think would be ok.  However, when I view pages including my topbar.ascx inside a browser and rollover a link, my status bar shows:

localhost:xxxxx/websitename/blog/~blog/default.aspx

Why on earth is websitename/blog/ getting added to the front of the url??  Is this an IIS issue?  I'm hoping this will be resolved when I publish live but I will be hosting the site on a shared server so maybe I will have the same issue??

Please can someone advise?
ASKER CERTIFIED SOLUTION
Avatar of Rajar Ahmed
Rajar Ahmed
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lorna70
Lorna70

ASKER

Yes this is only on my development machine so I thought that maybe when hosted using IIS the problem would disappear.  I'm setting up a new pc with Windows 7 so I can have IIS on my development machine (currently Vista :-().