ASP.NET AJAX UpdatePanel problem
- by Velika
I'll try and be concise:
1) I have a dropdownlist with Autopostback set to TRUE
2) I have an UpdatePanel that contains a Label.
3) When the downdownlist selection is changed, I want to update the label.
Problem: Focus is lost on the dropdownlist, forcing the user to click on the dropdownlist to reset focus back to the control.
My "solution": In the DropDownList_SelectionChanged event, set focus back to the drop down list:
dropdownlist1.focus()
Problem:
While this works great in IE, Firefox and Chrome change the scroll position such that the control which was assigned focus is positioned at the bottom on the visible portion of the browser window. This is often a very disorientating side effect.
How can this be avoided so it works in FF as it does in IE?