Wednesday, 16 January 2013

Maintaining Scroll Position after Asp.Net Page PostBack

Sometimes we need to Maintain scroll position after page postback specially if the page is a large page & user need to work in the middle portion of the page. In this article i will give you a simple tips on How to maintain Scroll Position after Asp.Net Page PostBack. To do that in the Page Directive of your large Asp.Net Page, add the property 'MaintainScrollPositionOnPostback' and set its value as 'true'.



For Example:
1<%@ Page Language="C#" CodeFile="Default.aspx.cs" MaintainScrollPositionOnPostback="true" Inherits="_Default" %>
Now, the page will maintain the scroll bar position in the same location as it is before postback.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.