The main thing is to use / rather than \ . You are not redirected to the folder on the server, but to the path on the website (the fact that this means that the folder on your server is just an implementation detail).
You can use all forms that you can use with relative links. Therefore, "staff/staff.aspx" goes to a file called staff.aspx in a folder called staff, which is in the current folder (assuming that your system is based on a folder and a file). "../staff/staff.aspx" goes up the folder, and then to staff, then to staff.aspx. "../../staff/staff.aspx" goes up the first two. "/staff/staff.aspx" goes to the root of the domain at ( http://mysite.com/staff/staff.aspx , etc.).
Like all of them, "~/staff/staff.aspx" goes to the root of the application, and then to the staff inside it, and then to staff.aspx. This is useful if you work on the site in such a way that it is at http://localhost/currentProject/staff/staff.aspx , because the project is located at http://localhost/currentProject/ , but deployed to http://mysite.com/staff/staff.aspx since the site is located at http://mysite.com/ . Thus, the same code works in both directions.
source share