asp.netvb.netpostbackmaintainscrollpositionon

Keep scroll position after Postback - 2019


Before I expose my problem, let me explain the reason why I ask this question again, after all others have been answered.

Short answer:

None of those worked for me.

Long answer:

I've been searching this topic, for over 1 year already and still got this problem unresolved.

I use a Masterpage and UpdatePanels in every Contentpage.

So it's starting to get annoying not being able to resolve this.

I've read somewhere that the MaintainScrollPositionOnPostback property no longer works with any of the browsers, but I might have misread that.

I'd appreciate your help :)!

Best regards!


Solution

  • For future reference.

    My problem resided in the code itself, using Control.Focus() "conflits" with the Scroll position.

    As @GaganDeep helpfully explained, one cannot use Control.Focus() and MaintainScrollPositionOnPostback="true" and the same time, as the Focus() Scrolls the page to the position of the referenced Control.

    Thank you for your help! I was really struggling with this one, never thought it could be such a "simple" thing.