shawn
shawn

Reputation:

Anchor not working in asp.net

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?

Upvotes: 1

Views: 2128

Answers (5)

Hanan
Hanan

Reputation: 1445

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).

Upvotes: 0

rafael
rafael

Reputation: 13

#INTRO not #Intro .. works.

Upvotes: 0

Joe Phillips
Joe Phillips

Reputation: 51200

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

The code you showed us looks fine.

Upvotes: 2

David McEwing
David McEwing

Reputation: 3340

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.

Upvotes: 0

atfergs
atfergs

Reputation: 1684

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

Upvotes: -1

Related Questions