locked
A folder for the general pages and getting error “The resource cannot be found” RRS feed

  • Question

  • User506034217 posted

    I've created a simple web application that include 3 web pages ; Home page , Register page and Login page . I've added a folder named Login and put Register page and Login page into it.(So the Home page is in the root directory and Login and Register pages are in the Login directory).Also i've added a tag with 3 tags as menu ; Home , Register and Login .

    <ul>
        <li><a href="HomePage.aspx">Home</a></li>
        <li><a href="Login/LoginPage.aspx">Home</a></li>    
        <li><a href="Login/RegisterPage.aspx">Home</a></li>
    </ul>

    For example , i start the HomePage , so in the address bar, address is :
    <kbd>" //localhost:3120/HomePage.aspx"</kbd>
    then if i click Register from the menu, the Register page will be opened . In this case the address is :
    <kbd>" //localhost:3120/Login/RegisterPage.aspx "</kbd>
    The problem is that ,if in the Register page i click again the <kbd>Home</kbd> from menu items ,on the address bar the address will be:
    <kbd>" //localhost:3120/Login/HomePage.aspx"</kbd>
    ("/Login" is added before "/HomePage") and "The resource cannot be found" error will be appeared.

    Friday, August 17, 2018 1:04 AM

Answers

  • User2103319870 posted

    The problem is that ,if in the Register page i click again the <kbd>Home</kbd> from menu items ,on the address bar the address will be:
    <kbd>" //localhost:3120/Login/HomePage.aspx"</kbd>
    ("/Login" is added before "/HomePage") and "The resource cannot be found" error will be appeared.

    You just need to redirect back to root folder from Register Page. Change your url like below

     <ul>
                    <li><a href="../HomePage.aspx">Home</a></li>
                    <li><a href="Login/LoginPage.aspx">Home</a></li>
                    <li><a href="Login/RegisterPage.aspx">Home</a></li>
                </ul>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 17, 2018 2:03 AM

All replies

  • User2103319870 posted

    The problem is that ,if in the Register page i click again the <kbd>Home</kbd> from menu items ,on the address bar the address will be:
    <kbd>" //localhost:3120/Login/HomePage.aspx"</kbd>
    ("/Login" is added before "/HomePage") and "The resource cannot be found" error will be appeared.

    You just need to redirect back to root folder from Register Page. Change your url like below

     <ul>
                    <li><a href="../HomePage.aspx">Home</a></li>
                    <li><a href="Login/LoginPage.aspx">Home</a></li>
                    <li><a href="Login/RegisterPage.aspx">Home</a></li>
                </ul>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 17, 2018 2:03 AM
  • User506034217 posted

    thanks A2H ... it work 

    Friday, August 17, 2018 9:36 AM