a question about relative paths

Discussion in 'ASP .Net' started by Abubakar, Mar 9, 2010.

  1. Abubakar

    Abubakar Guest

    Hi all,
    I am working on a asp.net website (using vs2k5). I have made a header.html
    which I include in all the pages. The header.html contains the code to draw
    menus. The menu code has urls for each item in the menus, like lets say
    "reports/page1.aspx". My problem is that the valid menus links from one
    location do not remain valid for another location. Lets say the page1.aspx
    was clicked, now the user is inside the "localhost/reports", and the menu
    header may contain something like "page2.aspx" which is not in the "reports"
    folder (hence invalid link if the user is inside /reports), so the
    page2.aspx link now should be "../page2.aspx". How do I fix this?

    Thanks,
    ab
     
    Abubakar, Mar 9, 2010
    #1
    1. Advertising

  2. Rather than including the menu in a header file, try putting the menu
    in a master page, with the other pages being content pages that use
    this master page.

    On Mar 8, 9:45 pm, "Abubakar" <> wrote:
    > Hi all,
    > I am working on a asp.net website (using vs2k5). I have made a header.html
    > which I include in all the pages. The header.html contains the code to draw
    > menus. The menu code has urls for each item in the menus, like lets say
    > "reports/page1.aspx". My problem is that the valid menus links from one
    > location do not remain valid for another location. Lets say the page1.aspx
    > was clicked, now the user is inside the "localhost/reports", and the menu
    > header may contain something like "page2.aspx" which is not in the "reports"
    > folder (hence invalid link if the user is inside /reports), so the
    > page2.aspx link now should be "../page2.aspx". How do I fix this?
    >
    > Thanks,
    > ab
     
    harborsparrow, Mar 9, 2010
    #2
    1. Advertising

  3. Abubakar

    Abubakar Guest

    But right now everything is already coded. I was trying to add a new folder
    and put a page there and things were not working as I expected, hence this
    question.
    Cant I just write the urls in the header.html in a way that all becomes
    relavent to the website's root path? Everything will work than.

    ab.

    "harborsparrow" <> wrote in message
    news:...
    > Rather than including the menu in a header file, try putting the menu
    > in a master page, with the other pages being content pages that use
    > this master page.
    >
    > On Mar 8, 9:45 pm, "Abubakar" <> wrote:
    >> Hi all,
    >> I am working on a asp.net website (using vs2k5). I have made a
    >> header.html
    >> which I include in all the pages. The header.html contains the code to
    >> draw
    >> menus. The menu code has urls for each item in the menus, like lets say
    >> "reports/page1.aspx". My problem is that the valid menus links from one
    >> location do not remain valid for another location. Lets say the
    >> page1.aspx
    >> was clicked, now the user is inside the "localhost/reports", and the menu
    >> header may contain something like "page2.aspx" which is not in the
    >> "reports"
    >> folder (hence invalid link if the user is inside /reports), so the
    >> page2.aspx link now should be "../page2.aspx". How do I fix this?
    >>
    >> Thanks,
    >> ab

    >
     
    Abubakar, Mar 9, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kathy Burke
    Replies:
    0
    Views:
    521
    Kathy Burke
    Nov 14, 2003
  2. Curt_C [MVP]

    Re: Relative Paths

    Curt_C [MVP], May 25, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    358
    =?Utf-8?B?QW5kcmV3IFdpZWQ=?=
    May 26, 2004
  3. Noah
    Replies:
    5
    Views:
    786
  4. Replies:
    3
    Views:
    383
    huntedsnark
    Aug 24, 2006
  5. Ohad Lutzky

    Paths, gentleman, paths

    Ohad Lutzky, Nov 6, 2006, in forum: Ruby
    Replies:
    2
    Views:
    197
    David Vallner
    Nov 7, 2006
Loading...

Share This Page