HyperLink.NavigateUrl always adds an extra ../ when going to a higher level directory

Discussion in 'ASP .Net Web Controls' started by Nathan Sokalski, May 30, 2005.

  1. Whenever I assign a value to the HyperLink.NavigateUrl property, it adds an
    extra ../ in the generated href= attribute of the anchor tag. For example,
    when I assign it the value "comments.aspx" the href attribute comes out as
    href="../comments.aspx" The location of the file with the code that
    generates the anchor is in the root directory, while the aspx file is one
    level deeper. Could this be the problem? If it is, how can I fix it so that
    I can use it in any directory? Here is my basic file structure:

    ROOT
    -navigation.ascx
    -navigation.ascx.vb (uses navbuttoninfo.vb)
    -navbuttoninfo.vb (this is the file where the NavigateUrl property is
    assigned)
    -PAGE THAT USES NAVIGATION.ASCX
    -PAGE THAT USES NAVIGATION.ASCX
    -PAGE THAT USES NAVIGATION.ASCX
    -PAGE THAT USES NAVIGATION.ASCX
    -PAGE THAT USES NAVIGATION.ASCX

    Thanks.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/
     
    Nathan Sokalski, May 30, 2005
    #1
    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. Nathan Sokalski
    Replies:
    0
    Views:
    739
    Nathan Sokalski
    May 30, 2005
  2. Christoph Haas
    Replies:
    4
    Views:
    331
    Christoph Haas
    Oct 2, 2005
  3. Iain
    Replies:
    7
    Views:
    556
    John Dunlop
    Oct 17, 2006
  4. Nathan Huesken
    Replies:
    0
    Views:
    275
    Nathan Huesken
    Jun 25, 2010
  5. Carl Grainger

    asp:hyperlink - NavigateURL is always relative. I need absolute.

    Carl Grainger, Sep 24, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    388
    Carl Grainger
    Sep 25, 2006
Loading...

Share This Page