Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
4.00/5 (3 votes)
See more:
solution explorer
site.master
default.aspx
while
admin (folder inside) admin.aspx

master page and some content pages (aspx pages) in root directory and some aspx pages in a folder also.
i do open admin.aspx page file (of admin folder)
now to local host url is:
localhost:port\admin\admin.aspx


then i try open default.aspx file (root directory) from admin.apsx i recive this url
localhost:port\admin\default.aspx

and this is error exactly (no resources found) true how to overcome this problem.

HTML
<ul role="navigation">
            <li>
              <a href="Default.aspx" ><span class="icon">S</span>Home
                </a>        ;</li>
            <li>
              <a href="admin\AdminFunction.aspx"><span class="icon">E</span>Admin</a>
            </li>
            <li>
              <a href="ContactUs.aspx"><span class="icon">M</span>Contact us</a>
            </li>
          </ul>
Posted
Updated 25-Apr-18 18:43pm

You could set the href attribute with the full path.
HTML
<ul role="navigation">
    <li>
        <a href="/Default.aspx">SHome</a>
    </li>
    <li>
        <a href="/admin/AdminFunction.aspx">EAdmin</a>
    </li>
    <li>
        <a href="/ContactUs.aspx">MContact us</a>
    </li>
</ul>
 
Share this answer
 
XML
you could set "/" before page name then it takes path from root directory

<ul role="navigation">
    <li>
        <a href="/Default.aspx"><span class="icon">S</span>Home</a>
    </li>
    <li>
        <a href="/admin/AdminFunction.aspx"><span class="icon">E</span>Admin</a>
    </li>
    <li>
        <a href="/ContactUs.aspx"><span class="icon">M</span>Contact us</a>
    </li>
</ul>
 
Share this answer
 
try the below sample.
JavaScript
<a href="~/admin/AdminFunction.aspx">EAdmin</a>
 
Share this answer
 
Comments
_tasos 3-Sep-13 6:26am    
The "~/" works with <asp:Hyperlink />, but not with the tag
Muhamad Faizan Khan 7-Sep-13 3:28am    
i use without ~ this but working fine.
<ul role="navigation">
            <li>
              <a href="../Default.aspx" ><span class="icon">S</span>Home
                </a>        ;</li>
            <li>
              <a href="../admin/AdminFunction.aspx"><span class="icon">E</span>Admin</a>
            </li>
            <li>
              <a href="../ContactUs.aspx"><span class="icon">M</span>Contact us</a>
            </li>
          </ul>


you can use ../ or ~/ Before Assigning Link, That indicates current Files or Folder
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900