tags:

views:

381

answers:

5

Hey everyone,

As the title suggests i've run into a problem with anchors ASP.NET.

I've set them up the same way as you would in standard html

ex:

<a href="#Intro">Introduction</a>
and then further down the page, 
<a name="Intro" ...

for some reason when i click the link, the #Intro isnt appended to the url, and i'm not taking to the anchor.

However, if i manually add the #Intro to the url it works.

Also, if i change the #Intro to a name which has no corresponding anchor with the given name attribute it IS appended to the query

What's going on?

A: 

Try dropping the quotes in the name tag and/or adding the page name to the anchor link.

orthod0ks
A: 

You have it around the wrong way. It should be NAME="INTRO" where you want the intro and HREF="#INTRO" when you want to go back to the intro.

David McEwing
That's what he has I think.
Joe Philllips
+1  A: 

This seems more like a browser issue or else you're not including enough code.

The code you showed us looks fine.

Joe Philllips
A: 

#INTRO not #Intro .. works.

rafael
A: 

Note that there should not be any postback to the server. This is all done on client-side, implemented by the browser. Try recreating this in another browser to disqualify the possibility that its some crazy browser issue. Scan the the source code (in browser, view source) of the page to understand if anything happens when user clicks the intro link (assuming of course you have no events on the links- in that case look for the problem there).

Hanan