tags:

views:

446

answers:

2

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?

A: 

Set the MaintainScrollPositionOnPostBack Property on the page.

Edit: Hmmm, okay ... is this similar to the issue you are seeing?

JP Alioto
I have that MaintainScrollPositionOnPostBack set to true and I'm still having the problem.
Don
<%@ Page Language="vb" EnableEventValidation="false" AutoEventWireup="false" MaintainScrollPositionOnPostback="true" enableviewstate="true" Codefile="xxx.aspx.vb" Inherits="xxx" %>
Don
No, it is not the scroll position in the panel it is the scroll positon of the page.
Don
A: 

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.

Don