The main problem is when a postback occur the page is moving to top. i tried a lot and finally got the solution.
if you are using IE then its very simple just put the code in your page directive.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"
MaintainScrollPositionOnPostback="true" %>
but it will not work in Firefox for that you have to add one browser file into your website
Right click on solution explorer > Add New Item
Select Browser File and add it to App_Browsers folder.
Add MaintainScrollPositionOnPostback capability to this browser file as written below.
<browsers>
<browser refID="Mozilla">
<capabilities>
<capability name="supportsMaintainScrollPositionOnPostback" value="true" />
</capabilities>
</browser>
</browsers>
Some times this also not work,
Then a simple solution just add a blank Update panel after the grid and onpostback just put the focus to that update panel
it will work in any browser.
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
</asp:UpdatePanel>
updatepanel1.Focus();
If anybody want source just give a comment.


Deepak KumarPosted Aug 24, 2020, 9:38 PM EDT
It is not working for me. I have foundation pop up and it have button on server side. On click of button it taking my screen to top.
Ankita BhagdikarPosted Nov 12, 2017, 3:43 AM EST
Kindly post the update panel code for maintaining the scroll position using gridview with dropdown list postback.
Sean LowryPosted Jun 12, 2016, 2:09 PM EDT
Hi Sanjeeb, a very nice, simple 'maintain scroll position on partial-postback' solution. Others I tried, including Javascript-based, didn't work. Yours worked first time, and all in code-behind. Well done!
Ammy NelsonPosted Feb 10, 2015, 2:19 AM EST
its not working for me please do needful