In ASP.NET you can force the browser to scroll back to the position it was prior to a postback. To enable this just add MaintainScrollPositionOnPostBack=”True” to your page declaration. This would look something like this:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="MyApp.WebForm4" MaintainScrollPositionOnPostBack=”True”%>This is great and all, but this doesn’t work with Master Pages. This is because Master Pages are really more like User Controls than a real page. Master Pages don’t have a Page declaration like above. Instead they have something similar, but instead of the word Page, it uses the word Master. It doesn’t support the MaintainScrollPositionOnPostBack property. What to do now? Option 1: Global Change If you want the change to affect all the pages in your application, you can put it in the web.config in the Pages element like the following.
<pages maintainScrollPositionOnPostBack="True">Option 2: Page Level Change On any page (even ones that use Master Pages), you can add this line to your Page_Load event. Page.MaintainScrollPositionOnPostBack = true; Option 3: Hybrid
You can combine the two options above. The setting in the web.config becomes the default. Then on any particular page you can add the one line to your Page_Load event to change the default behavior.