带有 autopostback =“true”的复选框在转发器内部,在 UpdatePanel 内部单击时将页面弹出回到顶部

发布于 2024-12-21 19:41:37 字数 250 浏览 3 评论 0原文

我有一个 UpdatePanel,其中包含一个基本上构建复选框列表的中继器。这些复选框通过“OnCheckedChanged”事件设置为 AutoPostback。

当用户选中复选框时,一切都会按预期发生,除了一件事,即页面弹出(或滚动)回到顶部。

导致此 UpdatePanel 刷新的其他控件不会导致此问题,即使只是不在我的中继器内但仍在 UpdatePAnel 内的普通复选框,也可以正常工作(无需滚动回顶部)...

有什么想法吗?

I have an UpdatePanel that contains a repeater that basically builds a list of checkboxes. Those check boxes are set to AutoPostback with an "OnCheckedChanged" event.

When the user checks a checkbox, everything happens as expected except for one thing, the page pops (or scrolls) back to the top.

Other controls that cause this UpdatePanel to refresh don't cause this issue, even just plain checkboxes that ARE NOT inside of my repeater, but still within the UpdatePAnel, work fine (no scroll back to top)...

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

破晓 2024-12-28 19:41:37

在顶部的设计视图(源代码)中打开页面,您会发现页面指令

尝试添加MaintainScrollPositionOnPostback =“true”

希望它有帮助!

open your page in designview (Source) at the top you will find pagedirectives

try adding MaintainScrollPositionOnPostback="true"

hope it helps !!!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文