SmartScroller



(5) Submit a Review

2,948 Downloads

37,814 Views


Description

ASP.NET changed the way we think about navigation on the web. Most of the functionality allowed by ASP.NET comes from the method of posting back to the same page in order to run server-side code. The first and most annoying issue realized from this method is the loss of client scroll position on each postback. Microsoft anticipated this and provided a very complex and sometimes buggy SmartNavigation option. This basically renders postbacks in a hidden IFrame and uses JavaScript to update the current page. SmartNavigation is not perfect, and does not work well in all situations. There is a lag time between the time action is performed on the page and the time the JavaScript gets around to updating the page. Since the screen doesn't "flicker" with SmartNavigation, the user may be left wondering if the page is responding at all. Other developers familiar (and fed up with) this scrolling issue have attempted to solve it by placing bookmarks near the control or the row of the datagrid that caused a postback. This still causes the page to return to a different position than the user was at just before postback. This method can also be time consuming and tedious to implement. Enter the SmartScroller control. With this custom server control, a developer just drags-and-drops it on the page and the problem is solved. Without any coding or effort, the control goes to work to save the scroll position of the page between postbacks. It is accurate to the pixel and works on BOTH Internet Explorer and Nescape (as early as version 4.7).

Syntax Example

Just add to page and it retains scroll position. 'Scroll to an (x,y) coordinate SmartScroller1.ScrollTo(0,100) 'Scroll directly to an object or an anchor with an ID attribute. 'This Feature is IE ONLY. SmartScroller1.ScrollToObject(MyDataGrid.ClientID) 'Decide to maintain x and y scroll positions separately SmartScroller1.MaintainScrollX = False SmartScroller1.MaintainScrollY = True 'More...

Reviews

Submit a review

Not Working in IE Resolved (kind of)

Reviewed by: shadowb0xx0r on Friday, February 17, 2006

2 Stars

I had the same issue as kauriIT - working in FF, but not in IE. The solution I found was to take the DOCTYPE schema reference off of the page to force it to render in quirks mode. It was: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> Now it's: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> Not a great solution though... It would be great if they would update this control.

Would not work with IE

Reviewed by: kauriIT on Monday, September 26, 2005

1 Stars

Dropped control on web page, worked fine with Firefox but failed to work on IE. Tried to get support help but no response.

nawar00

Reviewed by: nawar00 on Tuesday, February 08, 2005

5 Stars

Really usefull.

Rating

Reviewed by: ckloo on Friday, July 02, 2004

5 Stars

Good

works great

Reviewed by: bsmith80 on Thursday, July 17, 2003

5 Stars

Works great for saving scroll position during a postback. Much better than SmartNavigation.