Maintain your scroll position on ASP.NET web pages with MaintainScrollPositionOnPostback
In ASP.NET pages by adding the MaintainScrollPositionOnPostback property as
"true" to the Page tag, you can easily let your users keep their scroll positions on
postbacks.
By this property users can return to the same position in their client browsers
after the postbacks of web pages. If you do not set this property to true, it is
set to false by default and users will suffer especially in long web pages to
scroll down on the page to return back to where they were previously.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" MaintainScrollPositionOnPostback="true" %>
You see, the MaintainScrollPositionOnPostback is a boolean property which can
be "true" or "false"
MaintainScrollPositionOnPostback is a replacement of the SmartNavigation
property which is obsolete now.
Setting this property to true the following hidden form fields are added to
web page with values indicating the scroll positions.
<input type="hidden" name="__SCROLLPOSITIONX" id="__SCROLLPOSITIONX"
value="0" />
<input type="hidden" name="__SCROLLPOSITIONY" id="__SCROLLPOSITIONY"
value="1916" />
BlinkList
Del.icio.us
Digg
Furl
Simpy
Spurl
DZone
ma.gnolia
Shadows
|