I am Final Year IT Engineering student. I am Doing Content Management System in ASP.net for my college. I have given link on my master page for various pages in the application; where I have specified only relative path of those pages. When I run this project and follow any link it works well for only first time and for second time when I click any link it .net run time environment unable to find the absolute address of that page. This may be problem due to relative addressing. How can I resolve this problem? Can anybody help me out?
A:
If you just specify relative paths with no root qualifier, then the links are relative to the current page that the user is on.
You can solve this by using links that begin with ~/
, as the ~ character resolves to the application root.
womp
2010-04-08 17:57:59
A:
When you create your links, use the ~
notation for addressing the pages. So when you link to http://server/root/AboutPages/About.aspx
, rather than linking to ./AboutPages/About.aspx
you would link to ~/AboutPages/About.aspx
. This will correct all of these for you in server-side controls.
Jaxidian
2010-04-08 17:58:37