页移动到顶部的控制在UpdatePanel的回发 [英] Page moves to top on postback of control in updatepanel
本文介绍了页移动到顶部的控制在UpdatePanel的回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个更新面板在我的网页,随时随地我有一个控制回发呢,页面滚动备份到页面的顶部。
I have an update panel on my page and anytime I have a control postback in it, the page scrolls back up to the top of the page.
为什么会出现这种情况?我该如何解决这个问题?
Why would this happen? How can I fix this?
推荐答案
我用control.focus()在服务器端,以修正了这个问题。例如:
I used control.focus() on the server side to fixed this issue. For example:
Protected Sub ddlGroups_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlGroups.SelectedIndexChanged
LoadGroups()
ddlGroups.Focus()
End Sub
我不知道这是最好的方式,但它为我工作现在。
I don't know if this is the best way but it works for me right now.
这篇关于页移动到顶部的控制在UpdatePanel的回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文