Sunday, April 24, 2011

Maintaining the Scroll Position after post back in ASP.NET

Some of us may come across this situation, ie maintaining the scroll position after the page is post back. This is very useful when we have a gridview or data repeater or some thing like that, which shows a large amount of data and a button controls is place below page, so that user has to scroll a bit to reach there. After clicking on the button, the page is posted back, but the page is scrolled to top.
If you want to maintain the scroll position, add this attribute on the @page directive



<%@ Page Language="C#" MaintainScrollPositionOnPostback="true"



1 comment:

Ajax CalendarExtender displaying at wrong position in Chrome

< script type ="text/javascript" language ="javascript">     function onCalendarShown(sender, args)...