By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,288 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,288 IT Pros & Developers. It's quick & easy.

scrollIntoView called on postback

P: n/a
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
Nov 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.