0

How can I get the same scroll position after postback? I am doing code in vb. I have referred and tried everything mentioned in following question link.But nothing worked for me. How to overcome this problem?

Community
  • 1
  • 1
Manivel
  • 39
  • 1
  • 2
  • 10

4 Answers4

1

DO

Page.SmartNavigation = true

or

MaintainScrollPositionOnPostback = true

or

<%@ Page Language="C#" MaintainScrollPositionOnPostback="true" AutoEventWireup="true" CodeBehind="Default.aspx.cs"

put it in pageload outside of if(!Page.IsPostBack) if using

Md. Parvez Alam
  • 4,326
  • 5
  • 48
  • 108
  • MaintainScrollPositionOnPostback="true" is working in IE and not in Firefox. Is there any idea to get this work in firefox? – Manivel Mar 07 '14 at 06:05
  • while using first option it gives error msg as **Public Property SmartNavigation As Boolean is obsolete. The recommended alternative is Page.SetFocus() and MaintainScrollPositionOnPostback** – Manivel Mar 07 '14 at 09:01
0

MaintainScrollPositionOnPostback = "true" in page declaration should work

ale
  • 10,012
  • 5
  • 40
  • 49
0

You can Use Hidden Fields To store Your Scroll Bar Top and Left Values Before PostBack And then Obtain Same Value from Hidden Fields after PostBack

function BeforePostBack()
{
// Save Scroll Bar values in Hidden fields
// ScrollLeft() and ScrollTop()
}

function afterPostBack()
{
// Get Scroll Bar values from Hidden fields
// and assign to Scroll bars

}
Dgan
  • 10,077
  • 1
  • 29
  • 51
0

try using UpdatePanel.

that way you do not have to refresh the entire page during postback.

only the UpdatePanel will refresh during postback.

http://msdn.microsoft.com/en-US/library/bb386454.ASPX

j_t_fusion
  • 223
  • 2
  • 7
  • 20