There are four types of paths available in asp.net:
1. Absolute paths
2. Relative Path
3. Root Relative Path / Absolute virtual path(another name).
4. Application Relative Path / Domain relative path(another name).
1. Absolute Path:
(We usually use this to refer external websites).
2. Relative Path:
There are two types of Relative Paths.
1. client side
2. Server side
3. Root Relative Path / Absolute virtual path:
(normally used to hard code the path, not recommanded one)
4. Application Relative Path / Domain relative path
- comes with ~ symbol
- Normally ~ means - users home directory.
Now we will come to your problem solution. Normally if you face any problem with ~ , you can also use like this:
I will tell you one more interesting thing here - this ~ will work only with server side. but when you come to client side this will work with IE not with firefox.
During that time we have two kind of options (Navigateurl/Page.ResolveUrl) to use ~.
<asp:HyperLink NavigateUrl="~/yourdirectoryname/page.aspx" Text="Whatever" />
Or, use Page.ResolveUrl:
<a href="<%= Page.ResolveUrl("~/yourdirectoryname/page.aspx") %>">...</a>
HOpe this helps you.
KamalNerdanalysis, if this helps please login to Mark As Answer. | Alert Moderator