Monday, January 2, 2012

How to Set the position of Page when post back

Some times it happens that our web have a Grid View and Data Grid Contained lots of rows. Which makes Scrolling in Your page. If we clicks on a row and its redirect to another page then The Grid View and Data Grid Becomes Comes on Starting Position of Gridview or DataGrid. For Setting Your Grid View and Data Grid On Last Row Position the Given Below Property can be used.

Property of Page:

MaintainScrollPositionOnPostback ="true"


Example:




<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Reports.aspx.vb" Inherits="Reports" MaintainScrollPositionOnPostback ="true" %>


Note: If your Grid is inside the Update panel then will not work.

No comments:

Post a Comment