scrollIntoView called on postback

L

Larry Brown

Hi,

I'm working on an ASP.NET 2 application, with framework 2.0 beta. I have a
classic form, with a listbox. This field is in autopostback=true. When I
change the selected value, the page is reloaded, and the scrollIntoView
function is called at reload. It is called in the Webform_Autofocus(focusId)
function, whose call is included by ASP.NET at page generation. Here is the
code of this function:
function WebForm_AutoFocus(focusId) {
var targetControl;
if (__nonMSDOMBrowser) {
targetControl = document.getElementById(focusId);
}
else {
targetControl = document.all[focusId];
}
var focused = targetControl;
if (targetControl != null && (!WebForm_CanFocus(targetControl)) ) {
focused = WebForm_FindFirstFocusableChild(targetControl);
}
if (focused != null) {
try {
focused.focus();
focused.scrollIntoView();
if (window.__smartNav != null) {
window.__smartNav.ae = focused.id;
}
}
catch (e) {
}
}
}

The problem is that my form is inside an iframe. And the parent page is
scrolled, in order to put the field in the middle of the window.

Is there any way to disable the call to scrollIntoView after a postback?

Any help will be greatly appreciated !

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top