Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 16th, 2008, 12:22 PM
Registered User
Join Date: Nov 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Anchor Tag

Using the Anchor Tag need to reload a page (which is ok), but need to jump to a particular section of the page). The problem is the page reload is file, but upon reload jumping to a particular section on the page is what I am looking for..Any suggestions are welcome.
Tried putting a div tag enclosing the section that I wanted to have the focus upon, and then setting the focus via javascript when the required page reloaded. The problem is that since the section is down below in the page, when the page reloads upon the click of the anchor tag, the javascript for obvious reason does not find the div tag on the page (as the page has not completely reloaded).

Old November 16th, 2008, 04:02 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

Usually this is done with a named anchor tag:

<a name="focusHere"></a>

Then you link to the url that is on with the additional anchor name information:

<a href="mypage.aspx#focusHere">Click me</a>

If you want to do this with the javascript, you would typically put the javascript in the page's body tag onLoad handler do it fires after the page is loaded.

Old November 18th, 2008, 05:57 AM
Authorized User
Join Date: Jul 2007
Posts: 13
Thanks: 0
Thanked 1 Time in 1 Post

Thank you very much, it worked well for me...


Similar Threads
Thread Thread Starter Forum Replies Last Post
Anchor tag visited CSS related question mat41 Classic ASP Basics 0 April 16th, 2008 05:55 PM
Want to pass value at href in anchor tag on xslt Abhinavnaresh XSLT 4 February 21st, 2008 04:32 AM
place anchor tag around bgImage inside cell?? mat41 HTML Code Clinic 4 January 26th, 2006 07:42 AM
Problem with input type image With Anchor tag vinkumrect Javascript How-To 1 July 21st, 2005 08:59 AM
Javascript in Anchor Tag jamara JSP Basics 1 May 30th, 2005 01:00 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.