Anchor Tag in default.asp causes page to reload???

Discussion in 'ASP General' started by Dominic, Nov 12, 2003.

  1. Dominic

    Dominic Guest

    I have a home page on an intranet called default.asp I just type in
    the server name to take me to the default page http://server. The home
    page has an anchor name tag: <A name="fred">Freds Info</A>

    It is located by this anchor href tag: <A href="#fred">Up to Freds
    Info</A>

    The problem is that when I first use the link to take me up to Freds
    Info, the default.asp page is reloaded then I am taken to the Freds
    Info, which is a pain I dont want this to happen. I just want to click
    the link and be taken to the part on the page.

    After the page is reloaded I can then use the link again to go up to
    Freds Info without the page reloading. What is the problem? Any help
    would be appreciated. I am using IIS 4.0 on Windows NT.
    Dominic
     
    Dominic, Nov 12, 2003
    #1
    1. Advertising

  2. Have you accessed the file using //server/ or //server/default.asp? Can you
    put a copy of the page up somewhere, so we can try to reproduce, rather than
    guess what is really happening?




    "Dominic" <> wrote in message
    news:...
    > I have a home page on an intranet called default.asp I just type in
    > the server name to take me to the default page http://server. The home
    > page has an anchor name tag: <A name="fred">Freds Info</A>
    >
    > It is located by this anchor href tag: <A href="#fred">Up to Freds
    > Info</A>
    >
    > The problem is that when I first use the link to take me up to Freds
    > Info, the default.asp page is reloaded then I am taken to the Freds
    > Info, which is a pain I dont want this to happen. I just want to click
    > the link and be taken to the part on the page.
    >
    > After the page is reloaded I can then use the link again to go up to
    > Freds Info without the page reloading. What is the problem? Any help
    > would be appreciated. I am using IIS 4.0 on Windows NT.
    > Dominic
     
    Aaron Bertrand [MVP], Nov 12, 2003
    #2
    1. Advertising

  3. Dominic

    Evertjan. Guest

    Dominic wrote on 12 nov 2003 in microsoft.public.inetserver.asp.general:

    > I have a home page on an intranet called default.asp I just type in
    > the server name to take me to the default page http://server. The home
    > page has an anchor name tag: <A name="fred">Freds Info</A>
    >
    > It is located by this anchor href tag: <A href="#fred">Up to Freds
    > Info</A>
    >


    1 This has nothing to do with ASP, so please follow up on a clientside NG.

    2 Cashe reloading is standard behavour of accessing an anchor, intra or
    internet. An eventual server reload is possibly caused by an non-cashe
    command. If you just want to scroll use clientside javascript scrollTo() in
    an onclick.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Nov 12, 2003
    #3
  4. Dominic

    Dominic Guest

    Hello Evertjan and Aaron thanks for your replys.

    This is what I see in the message window of IE5.0 when I hover over
    the link.

    http://Server/#fred

    I think it should be http://Server#fred

    Seeing that I have the default document already in the temporary
    internet file folder as http://Server it should not have to ask the
    server for a new page.

    However I do have Cache:Control no-cache as a header in IIS4.0 so that
    documents loaded to the browser from the default page links are not
    cached.

    The Html for the anchor tags is the same as previously posted.

    I am not sure of the scrollTo()?? or how it works and what does NG
    mean?

    Thanks people.
    Dominic




    >
    > 1 This has nothing to do with ASP, so please follow up on a clientside NG.
    >
    > 2 Cashe reloading is standard behavour of accessing an anchor, intra or
    > internet. An eventual server reload is possibly caused by an non-cashe
    > command. If you just want to scroll use clientside javascript scrollTo() in
    > an onclick.
     
    Dominic, Nov 12, 2003
    #4
  5. Dominic

    Evertjan. Guest

    Dominic wrote on 13 nov 2003 in microsoft.public.inetserver.asp.general:
    > This is what I see in the message window of IE5.0 when I hover over
    > the link.


    In the status bar, I preaume.

    > http://Server/#fred
    >
    > I think it should be http://Server#fred


    No, no,

    http://Server and http://Server/ are short for http://Server/index.asp
    [if your IIS defaults to index.asp, that is].

    http://Server/#fred means http://Server/index.asp#fred

    http://Server#fred is illogical and probably would not work, because
    Server is not a file but the virtual root directory. You can try it in
    your browser and wil see the browser replaces that immediately by adding
    the slash. [IE6 tested]

    > Seeing that I have the default document already in the temporary
    > internet file folder as http://Server it should not have to ask the
    > server for a new page.
    >
    > However I do have Cache:Control no-cache as a header in IIS4.0 so that
    > documents loaded to the browser from the default page links are not
    > cached.


    It does not influence the links, just the pages themselves.

    So every http://Server/index.asp#fred will reload from the server, as
    promised.

    Why not remove the no-cache if you hate it for this page.

    > [..]
    > I am not sure of the scrollTo()?? or how it works and what does NG
    > mean?


    scrollTo() is clientside Javascript [you were in fact asking for a
    clientside solution] and NG is [this] NewsGroup

    [please do not bottom quote on usenet, but top/interquote sparingly]

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Nov 13, 2003
    #5
  6. Aaron Bertrand - MVP, Nov 13, 2003
    #6
  7. Dominic

    Dominic Guest

    Thanks again Aaron and Evertjan,
    You have been both helpful :)
    I can understand now Evertjan about what you have been showing me and
    I guess because I have the no-cache turned on that this is the main
    problem, not the asp and not the html. I will turn it off and see how
    I go. Thanks for all the other bits you have identified such as the
    'status bar' and the http:server/ etc.
    Aaron thanks for your help.
    I'll be back with good news I hope.
    cheers
    Dominic
     
    Dominic, Nov 14, 2003
    #7
    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. UJ
    Replies:
    2
    Views:
    6,519
    Lucas Tam
    Aug 12, 2005
  2. shruds
    Replies:
    1
    Views:
    854
    John C. Bollinger
    Jan 27, 2006
  3. =?Utf-8?B?SmVycnkgSg==?=

    anchor causes asp:requiredfieldvalidator to light up

    =?Utf-8?B?SmVycnkgSg==?=, Dec 8, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    346
    =?Utf-8?B?SmVycnkgSg==?=
    Dec 8, 2006
  4. eivind

    div tag and anchor tag

    eivind, Jan 5, 2004, in forum: Javascript
    Replies:
    1
    Views:
    129
    eivind
    Jan 15, 2004
  5. news.versatel.de

    print page from anchor tag on

    news.versatel.de, Oct 27, 2004, in forum: Javascript
    Replies:
    0
    Views:
    355
    news.versatel.de
    Oct 27, 2004
Loading...

Share This Page