页移动到顶部的控制在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...

我有一个更新面板在我的网页,随时随地我有一个控制回发呢,页面滚动备份到页面的顶部。

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.

阅读全文

相关推荐

最新文章