Hi all.

I just realize that the MaintainScrollPositionOnPostback property in the
ASP.NET Page class interfere with jQuery, causing an error in jQuery. I
don't know if there is a way of preventing this in error from jQuerys
perspective. My workaround is simply to remove
MaintainScrollPositionOnPostback from my ASP.NET page. When
MaintainScrollPositionOnPostback is enabled ASP.NET injects this script into
the page:
// from firebug...
function WebForm_GetScrollX() {310 if (__nonMSDOMBrowser) {
311 return window.pageXOffset;
312 }
313 else {
314 if (document.documentElement && document.documentElement.scrollLeft) {
315 return document.documentElement.scrollLeft;
316 }
317 else if (document.body) {
318 return document.body.scrollLeft;
319 }
320 }
321 return 0;
322}
323function WebForm_GetScrollY() {
324 if (__nonMSDOMBrowser) {
325 return window.pageYOffset;
326 }
327 else {
328 if (document.documentElement && document.documentElement.scrollTop) {
329 return document.documentElement.scrollTop;
330 }
331 else if (document.body) {
332 return document.body.scrollTop;
333 }
334 }
335 return 0;
336}
337function WebForm_SaveScrollPositionSubmit() {
338 if (__nonMSDOMBrowser) {
339 theForm.elements['__SCROLLPOSITIONY'].value = window.pageYOffset;
340 theForm.elements['__SCROLLPOSITIONX'].value = window.pageXOffset;
341 }
342 else {
343 theForm.__SCROLLPOSITIONX.value = WebForm_GetScrollX();
344 theForm.__SCROLLPOSITIONY.value = WebForm_GetScrollY();
345 }
346 if ((typeof(this.oldSubmit) != "undefined") && (this.oldSubmit != null))
{
347 return this.oldSubmit();
348 }
349 return true;
350}
351function WebForm_SaveScrollPositionOnSubmit() {
352 theForm.__SCROLLPOSITIONX.value = WebForm_GetScrollX();
353 theForm.__SCROLLPOSITIONY.value = WebForm_GetScrollY();
354 if ((typeof(this.oldOnSubmit) != "undefined") && (this.oldOnSubmit !=
null)) {
355 return this.oldOnSubmit();
356 }
357 return true;
358}
359function WebForm_RestoreScrollPosition() {
360 if (__nonMSDOMBrowser) {
361 window.scrollTo(theForm.elements['__SCROLLPOSITIONX'].value,
theForm.elements['__SCROLLPOSITIONY'].value);
362 }
363 else {
364 window.scrollTo(theForm.__SCROLLPOSITIONX.value,
theForm.__SCROLLPOSITIONY.value);
365 }
366 if ((typeof(theForm.oldOnLoad) != "undefined") && (theForm.oldOnLoad !=
null)) {
367 return theForm.oldOnLoad();
368 }
369 return true;
370}
Just wanted to let you guys know. :-)
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to