65.9K
CodeProject is changing. Read more.
Home

Crossbrowser SmartNavigation Alternative II

starIconstarIconstarIconstarIconstarIcon

5.00/5 (11 votes)

Apr 3, 2005

viewsIcon

161663

downloadIcon

617

An article describing how to create a server control that preserves the scroll position in longer pages.

Introduction

In my previous article, I have introduced Crossbrowser SmartNavigation Alternative. However, this doesn't support link buttons, because the link buttons either does not submit the form or does not fire an event. Instead of getting the scroll positions in the onsubmit event, getting them in the onscroll event is better. But other browsers badly supports the onscroll event. This event is fired when mouse moves the scroll in other browsers. So I get the scroll positions using onscroll, onkeypress and onclick events in other browsers.

I have tested this on Internet Explorer 6.0, FireFox 1.0 and Netcape 7.2.

Adding this control to your page

Insert this code to the head of your page.

<%@ Register TagPrefix="cc1" Namespace="Uludag" Assembly="lili2" %>

And insert this code into your form.

<cc1:Lili2 id="Lili1" runat="server"/>

Or, you can follow the instructions in my previous article.

I hope this helps somebody out there, I would be interested in receiving any comments.