6.1. The Document Fragment Indicator

Browsers don't only create navigation history points when a page loads. For years they have supported fragment indicators. You may have used this feature before. Most commonly it is used to allow for links on a document to point to different sections of it. For example, a long listing of products on a product listing page might include a "back to top" link after each product, which returns the user back to the top of the document when clicking on it. These types of links use anchor tags whose href value uses the # symbol, known as a fragment indicator. It tells the browser to jump the scroll position to the portion of the page with that name.

<a name="top"></a>
...
<a href="#here">Back to Top</a>

The great thing about this browser feature is that it creates a navigation history point even though the page isn't actually changed. This makes it the perfect candidate for adding logical navigation points to an AJAX-enabled page.

Get Professional ASP.NET 3.5 AJAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.