Search This Blog

Monday 6 July 2015

How to maintain page scroll position after a page postback in asp.net or Maintain scroll position on postback in asp.net or Reset the page scroll position after a PostBack

Use page property maintainScrollPositionOnPostBack="true"

Step 1:- Web.config

<configuration>
  <system.web>
  <pages maintainScrollPositionOnPostBack="true">
  </system.web>
</configuration>

Step 2:- Page Level

<%@ Page Title="Home" Language="C#" MasterPageFile="~/Masters/Layout.Master" MaintainScrollPositionOnPostback="true" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="Demo.Home" %>


2 comments:

  1. its not working for me... i mentioned maintainscrollpositiononpostback both on master page and web config..still not working

    ReplyDelete
  2. i tried both your steps.. even after that the page refereshs and moves to top

    ReplyDelete