Reset scroll position after Async postback - ASP.NET

前端 未结 8 1401
花落未央
花落未央 2020-11-30 06:08

What is the best way to reset the scroll position to the top of page after the an asynchronous postback?

The asynchronous postback is initiated from a ASP.NET Grid

8条回答
  •  [愿得一人]
    2020-11-30 07:04

    I use a hidden Input called hScrollTop that I set before the asp.net Form is posted back. Then, when the page loads, it sets the scrollTop according to the hidden input's value.

    Try this code on a new page.

提交回复
热议问题