简体   繁体   English

更新面板记住滚动位置不起作用

[英]Update Panel remember scroll position not working

This subject has been covered many times however no matter what code I look at none of them work. 这个主题已经被讨论过很多次了,但是不管我看什么代码,它们都不起作用。

I am using Update Panels and when the update panel gets refreshed in async it shoots the scroll bar to the top. 我正在使用“更新面板”,并且当更新面板以异步方式刷新时,它会将滚动条拍到顶部。 I have tried Javascript method with no avail, I have tried adding smartNavigation="True" MaintainScrollPositionOnPostback="True" to the top of page still no avail. 我尝试了无济于事的Javascript方法,尝试将smartNavigation =“ True” MaintenanceScrollPositionOnPostback =“ True”添加到页面顶部仍然无济于事。

Can someone please give me a working version of keeping the scrollbar position after Async Postback. 有人可以给我一个在异步回发后保持滚动条位置的工作版本。

为了解决这一问题,我必须在客户端完成此操作,因此在构建列表视图时,我在表行上有一个ID,该ID称为javascript函数,该ID将ID号存储在我正在查看的cookie中,然后我在我使用id时使用了scrollIntoView()javascript方法,这使我能够在异步回发后始终滚动回到该位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM